# Lists and filtering

A page that is a list of records: views, search, a filter, the table and row selection.

## When it applies

- A page lists every record of one kind, and people narrow it down to find one or act on several.
- Not for the tables inside the opportunity or contact workspace, which use Workspace Table.

## Components

- [Segmented Control](../components/segmented-control.md): The list's views, on the left of the toolbar.
- [Input](../components/input.md): The search, with `clearable`.
- [Select](../components/select.md): One filter each, like status.
- [Table](../components/table.md): The list itself, with `variant="main"`.
- [Checkbox](../components/checkbox.md): Row selection, at the start of each row.
- [Badge](../components/badge.md): A record's status, in its own cell.
- [Truncate](../components/truncate.md): A long value, like a trust's full name.
- [Empty Value](../components/empty-value.md): A cell with nothing in it.
- [Empty State](../components/empty-state.md): What shows when nothing matches.
- [Scroll Area](../components/scroll-area.md): The table's scrolling on a narrow window.

## Rules

- Do: Use `Table` with `variant="main"` for a full-page list, edge to edge under one toolbar, with no page title and no padding around it. `WorkspaceTable` is for the tables inside a workspace.
- Do: Name a search or filter that stands outside a `Field` with `aria-label`, like "Search records", and set `clearable` on the search.
- Do: Wrap a long value in `Truncate`, so the cell keeps its width and the full value shows on hover, and show an empty cell with `EmptyValue`.
- Do: When nothing matches, show an `EmptyState` that names what's missing, with at most one action, like Clear filters.
- Don't: Tint a row in its status colour. Put the status in a `Badge` in its own cell, so colour stays an accent and the row stays readable.
- Don't: Move the checkbox to the end of the row. Only a menu's selection tick sits on the right.
- Don't: Scroll the table with `overflow-auto`. Put it in a `ScrollArea`.

## See it

- [List page](../screens/example-list-page.md): A page that is a list: one toolbar under the header with views, search and a filter, and a table that fills the rest of the window edge to edge.
