DataTable
A config-driven data grid — sort, filter, select, and inline-edit.
The batteries-included, API-driven data grid: pass columns + data and get sorting (click a header), a search filter, row selection (with select-all), and inline editing — all controllable via props. Built on the composable Table primitives, so it inherits the same look. Generic over any row type with a string id.
Use this for real application tables. Reach for RecordsTable only when you specifically want Attio's records grid (typed-cell pickers, sticky columns, bulk bar); use Table when you want to lay out cells by hand.
Preview
Try it — sort by any header, search, select rows, and click a Name or Role cell to edit it.
| Domain | Categories | ||||
|---|---|---|---|---|---|
| GGoogle | google.com | 182,000 | Customer | ||
| SStripe | stripe.com | 8,000 | Lead | ||
| FFigma | figma.com | 1,300 | Customer | ||
| NNotion | notion.so | 800 | Prospect | ||
| VVercel | vercel.com | 500 | Customer | ||
| LLinear | linear.app | 60 | Lead | ||
| 192,660 | |||||
Usage
import { DataTable, type DataTableColumn } from "crisp";
const columns: DataTableColumn<Person>[] = [
{ key: "name", header: "Name", sortable: true, editable: true },
{ key: "status", header: "Status", sortable: true,
render: (v) => <Badge tone={v === "active" ? "success" : "neutral"} dot>{v}</Badge> },
{ key: "score", header: "Score", sortable: true, align: "right" },
];
<DataTable
columns={columns}
data={people}
filterable
selectable
interactive
defaultSort={{ key: "score", dir: "desc" }}
onSelectionChange={setSelected}
onEdit={(id, key, value) => update(id, key, value)}
/>;API
DataTableProps<T>
| Prop | Type | Description |
|---|---|---|
columns | DataTableColumn<T>[] | Column config (see below). |
data | T[] | Rows; each needs a string id. |
selectable | boolean | Show a selection column + select-all. |
selectedIds / onSelectionChange | string[] / (ids) => void | Controlled selection. |
sort / defaultSort / onSortChange | SortState | null | Controlled or seeded sort. |
filterable | boolean | Show the search box. |
onEdit | (id, key, value) => void | Commit handler for inline edits. |
interactive / onRowClick | boolean / (row) => void | Row hover + click. |
empty | ReactNode | Body content when there are no rows. |
DataTableColumn<T>
key, header, and optional sortable, filterable, editable, align, width, render(value, row), and accessor(row) (derive the sort/filter/display value).