Specify number of items of a collection to display

Background-Info: I am building a grid that displays all categories of products on a website. The grid items consist of a background-image, the title of the category and its’ first three child-categories.

Is there any way to tell a page collection definition to display only a certain number of elements? The definition is working as expected, but i only want to to show the first 3 items. Or do I have to define the limitation of displayed elements in twig? if yes, please give me a hint how this has to be made.

Thx :slight_smile:

God … RTFM …

For your info, i managed it by using the twig slice filter in twig:

{% for category in page.collection|slice(0,3) %}