Unable to add list items in item-list.html.twig I need to display some links in a list and I'm using item_list theme for this:

$ii = array(
  'id-1' =&gt; array('name' =&gt; 'name1', 'class' =&gt; 'class-1'),
  'id-2' =&gt; array('name' =&gt; 'name2', 'class' =&gt; 'class-2'),
);
$iii = array(); 
foreach ($ii as $key =&gt; $value) {
  $iii[] = array('#value' =&gt; '&lt;a class="'.$key.'" href="http://test.com"&gt;'.$value['name'].'&lt;/a&gt;', '#wrapper_attributes' =&gt; array('class' =&gt; 'class-id'));
}

$aa = array(
  '#theme' =&gt; 'item_list',
  '#items' =&gt; $iii, //list of items to be displayed
  '#list_type' =&gt; 'ul',
);
print_r(drupal_render($aa)-&gt;__toString());


But on running this, I got an output of:

&lt;div class="item-list"&gt;&lt;ul&gt;&lt;li class="class-id"&gt;&lt;/li&gt;&lt;li class="class-id"&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;


where &lt;li&gt; tags are empty and 2 empty bullets are displayed on the front-end.

What I'm doing wrong?
There is no such thing as #value, you want #markup instead, There are also better ways to create links, although I'm not 100% sure right now if you can provide #wrapper_attributes then, but you can call getRenderable() on the link, then you get a render array and should be able to it on that.:

\Drupal\Core\Link::fromTextAndUrl($value['name'], \Drupal\Core\Url::fromUri('http://test.com'))