How to make limits for the loop in twig
If you need to make limits in the loop in twig tample, you make use |slice().
For example, you need show only first three element in loop
{% for child in category.children|slice(0, 3) %}
<li>
<a href="{{ child['href'] }}">{{ child['name'] }}</a>
</li>
{% endfor %}