# List Views

A list view is a list-based view of a collection entity providing features: pagination for large collections, custom data views, searching, and bulk actions.

![A collection list view](/files/r50XcRlkDpdSH2sICpNG)

## Configuring a list view

The list view configuration is a sub-configuration of a [`Collection`](/umbraco-ui-builder/13.latest/collections/the-basics.md) config builder instance and is accessed via its `ListView` method.

### **ListView(Lambda listViewConfig = null) : ListViewConfigBuilder\<TEntityType>**

Accesses the list view config of the given collection.

```csharp
// Example
collectionConfig.ListView(listViewConfig => {
    ...
});
```

## Adding a field to the list view

### **AddField(Lambda propertyExpression, Lambda fieldConfig = null) : ListViewFieldConfigBuilder\<TEntityType, TValueType>**

Adds the given property to the list view.

```csharp
// Example
listViewConfig.AddField(p => p.FirstName, fieldConfig => {
    ...
});
```

## Changing the heading of a field

### **SetHeading(string heading) : ListViewFieldConfigBuilder\<TEntityType, TValueType>**

Sets the heading for the list view field.

```csharp
// Example
fieldConfig.SetHeading("First Name");
```

## Formatting the value of a field

### **SetFormat(Lambda formatExpression) : ListViewFieldConfigBuilder\<TEntityType, TValueType>**

Sets the format expression for the list view field.

```csharp
// Example
fieldConfig.SetFormat((v, p) => $"{v} years old");
```

## Setting the view of a field

With field views, you can customize the markup the list view's field so you can show richer visualizations of the field's content. For more information you can check the [Field Views Documentation](/umbraco-ui-builder/13.latest/collections/list-views/field-views.md).

### **SetView(string viewComponentName) : ListViewFieldConfigBuilder\<TEntityType, TValueType>**

Sets the view component for the list view field.

```csharp
// Example
fieldConfig.SetView("ImageFieldView");
```

### **SetView\<TView>() : ListViewFieldConfigBuilder\<TEntityType, TValueType>**

Sets the view component for the list view field.

```csharp
// Example
fieldConfig.SetView<ImageFieldView>();
```

## Setting the visibility of a field

### **SetVisibility(Predicate\<ListViewFieldVisibilityContext> visibilityExpression) : ListViewFieldConfigBuilder\<TEntityType, TValueType>**

Sets the runtime visibility of the list view field.

```csharp
// Example
fieldConfig.SetVisibility(ctx => ctx.UserGroups.Any(x => x.Alias == "editor"));
```

## Changing the page size

### **SetPageSize(int pageSize) : ListViewConfigBuilder\<TEntityType>**

Sets the number of items to display per page for the given list view.

```csharp
// Example
listViewConfig.SetPageSize(20);
```


---

# 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.umbraco.com/umbraco-ui-builder/13.latest/collections/list-views.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.
