---
title: List
description: Display records with shared fields or configure each item.
---

Use `list(data)` when every record has the same fields. Use `list(data, callback)`
when individual rows need different fields or controls. Both forms accept the
records first, so callbacks receive the record type.

## Record list

<BacklitExample path="list/record" view="list" />

`setFields` accepts `leading`, `title`, `description`, `meta`, and `trailing`.
`title` requires at least one field. `leading` and `trailing` accept at most
two fields each. `meta` accepts at most four. A position accepts one builder or
an array of builders. Calling `setFields` replaces all positions.

`onRowClick(linkTo(...))` makes a row a link. `setRowActions` accepts visit and
action targets. Use `setDensity('compact')` to omit the description line.
`onDefect` receives invalid field values with their row index.

## Item list

<BacklitExample path="list/items" view="list" />

The callback receives a fresh `ListItemBuilder` and the row. Call `setFields`,
`onClick`, and `setActions` on that item. The same position limits apply.
The item list itself supports `setDensity`, `onDefect`, and `setPaginator`.
It does not have shared field declarations or a target registry.

Record lists support `setPaginator` and `setSorter`. See
[Search state](/reference/state). Passing an empty data array produces an empty
list. A record list must still declare its title fields.
