# 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="/files/eQfI6EfY0XaV62hB1wJ6" 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="/files/F7w2apz0KwU1Pm5CMGvL" 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="/files/cGpgdfFS1SDLOIR1Dy1b" 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="/pages/P2ONqXC2gmBBvXmNWNNH" %}
[Configuring server-side pagination](/concepts/components/work-with-components/table-server-side-pagination.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uibakery.io/reference/working-with-components/list-view.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
