# List View

## Overview

The List View component serves to display a collection of items. By default, it contains an image and a text field which can be replaced with the required components.\
If you need to create a custom layout, you can add the necessary components to the first list item. The added components are replicated for the other list view items.

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FVZj9jKQbGj4UnHIVGm1e%2FCleanShot%202025-08-04%20at%2017.03.04%402x-min.png?alt=media&#x26;token=9a0c4102-e362-4bc0-b985-ca2441946971" alt=""><figcaption></figcaption></figure>

### Properties

<table><thead><tr><th width="170.3125">Name</th><th width="215.22265625">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>string</code></td><td>Component name</td></tr><tr><td><code>pageSize</code></td><td><code>number</code></td><td>Number of items displayed per page</td></tr><tr><td><code>pageCount</code></td><td><code>number</code></td><td>Total number of pages</td></tr><tr><td><code>activePageIndex</code></td><td><code>number</code></td><td>Current active page index</td></tr><tr><td><code>paginationOffset</code></td><td><code>number</code></td><td>Offset used for pagination</td></tr><tr><td><code>afterCursor</code></td><td><code>string</code></td><td>Cursor for paginated data fetching</td></tr><tr><td><code>value</code></td><td><code>value[]</code></td><td>Current component value (array of data)</td></tr><tr><td><code>children</code></td><td><p><code>GridViewItemApi&#x3C;Value,</code> </p><p><code>Children>[]</code></p></td><td>Child items inside the list view</td></tr><tr><td><code>valid</code></td><td><code>boolean</code></td><td>Indicates if the component is valid</td></tr></tbody></table>

### Methods

<table><thead><tr><th width="156.16796875">Name</th><th width="147.53515625">Parameters</th><th width="101.875">Returns</th><th>Description</th></tr></thead><tbody><tr><td><code>setPage</code></td><td><code>index: number</code></td><td><code>void</code></td><td>Navigate to a specific page within the list view</td></tr><tr><td><code>setPageSize</code></td><td><code>size: number</code></td><td><code>void</code></td><td>Set the number of items displayed per page</td></tr><tr><td><code>setValue</code></td><td><code>data: object[]</code></td><td><code>void</code></td><td>Set component data. Data is an <code>object[]</code> with arbitrary structure.</td></tr><tr><td><code>resetValue</code></td><td>–</td><td><code>void</code></td><td>Reset component to the initial value</td></tr><tr><td><code>validate</code></td><td>–</td><td><code>void</code></td><td>Trigger form validation</td></tr><tr><td><code>resetValidation</code></td><td>–</td><td><code>void</code></td><td>Clear validation errors</td></tr></tbody></table>

### Triggers

<table><thead><tr><th width="228.74609375">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>On Init</strong></td><td>Triggered when the component is initialized</td></tr><tr><td><strong>On Page Change</strong></td><td>Triggered when the component page changes</td></tr><tr><td><strong>On Items Per Page Change</strong></td><td>Triggered when the component page item changes</td></tr></tbody></table>

## Working with the component

List View supports both static and dynamic data. To display data dynamically from your action, select the action you need in the *Data* property dropdown of the component.

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FAu9Sv3AZ8Wyy054YbblB%2FCleanShot%202025-08-05%20at%2013.24.12%402x-min.png?alt=media&#x26;token=98574216-2a98-42d6-a55f-823a48c4fc6b" alt=""><figcaption></figcaption></figure>

### Accessing List items

You can access any list item by referencing it as `{{item}}`, for example, `{{item.first_name}}`. To reference the index of the item, you can use the `{{index}}` variable.

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FVwsOn0EwLIEzjjSs47Me%2FCleanShot%202025-08-05%20at%2013.27.44%402x-min.png?alt=media&#x26;token=1eb94736-4824-4672-a438-264d01b3cd14" alt=""><figcaption></figcaption></figure>

### Server-side pagination

If you have a large dataset, you may find it useful to use server-side pagination. You will find details on how to set it up in the article below:point\_down:

{% content-ref url="../../concepts/components/work-with-components/table-server-side-pagination" %}
[table-server-side-pagination](https://docs.uibakery.io/concepts/components/work-with-components/table-server-side-pagination)
{% endcontent-ref %}
