

<Preview name="InteractiveStatesExample" />

`DataTable` is Cubitt's table renderer on top of TanStack Table. The core component owns layout, row models, and feature flags like sorting, pinning, resizing, pagination, selection, and virtualization.

The surrounding table experience is intentionally composable:

* Search is composed with `useSearch` and input primitives.
* Column visibility is composed with `useDataTableColumnVisibility` and menu primitives.
* Filtering is composed with `Filters` and `useFiltersTanstack(...)`.
* Bulk actions are usually composed with the `SelectionToolbar` primitive.
* Inline edit and component overrides are opt-in extensions on the table itself.

### Core [#core]

<Cards>
  <Card title="Columns" href="./columns">
    Column ids, accessors, renderers, sizing, and the DataTable-specific column
    metadata.
  </Card>

  <Card title="Table Features" href="./features">
    Sorting, pinning, resizing, pagination, and controlled table state.
  </Card>
</Cards>

### Composition [#composition]

<Cards>
  <Card title="Search" href="./search">
    Compose row search with `useSearch`, `SearchExpand`, and `DataTable`.
  </Card>

  <Card title="Filtering" href="./filtering">
    Compose structured column filters with `Filters`,
    `useFiltersTanstack`, and `DataTable`.
  </Card>

  <Card title="Column Visibility" href="./column-visibility">
    Control visible columns with a dedicated hook and menu primitives.
  </Card>

  <Card title="Selection" href="./selection">
    Built-in row selection, controlled id-based selection, and bulk actions.
  </Card>

  <Card title="States" href="./states">
    Loading, empty, error, and custom skeleton rendering.
  </Card>
</Cards>

### Extending [#extending]

<Cards>
  <Card title="Edit Mode" href="./edit-mode">
    Inline text, select, and markdown editors with commit hooks.
  </Card>

  <Card title="Custom Components" href="./custom-components">
    Override table primitives and derive row, header, and cell props.
  </Card>
</Cards>

### Performance [#performance]

<Cards>
  <Card title="Virtualisation" href="./virtualisation">
    Container, window, and custom-scroll virtualisation modes.
  </Card>

  <Card title="Optimisation" href="./optimisation">
    Practical guidance for stable columns, data flow, and large datasets.
  </Card>
</Cards>

## Mental Model [#mental-model]

* Your `columns` define identity, rendering, sizing, and optional table metadata.
* `DataTable` renders the table and wires TanStack row models based on the feature flags you enable.
* Adjacent hooks own URL state and surrounding UI where that keeps the table API smaller and more reusable.
* Performance-sensitive features like inline edit and virtualization stay opt-in.

<Callout type="info">
  Start with [Columns](./columns) and [Table Features](./features), then jump
  into the composition or performance pages you actually need.
</Callout>
