Data table
componentThe generic data table behind compare, organizer, scoreboards, and leaderboards.
Install
npx shadcn@latest add @engram/data-tableRegistry item: /r/data-table.json — the machine-readable definition agents install from.
Example
506 | 506 | 23 | 41 | 67 | 48 | |
503 | 503 | 70 | 62 | 28 | 45 | |
460 | 460 | 25 | 57 | 47 | 32 | |
454 | 454 | 59 | 0 | 0 | 0 | |
444 | 444 | 21 | 55 | 65 | 63 |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
columns* | DataTableColumn<Row>[] | — | — |
rows* | Row[] | — | — |
rowKey* | (row: Row, index: number) => string | — | Stable row id (also the selection key). |
sort | SortState | — | Controlled sort; omit to let the table manage it. |
defaultSort | SortState | — | Initial sort when uncontrolled. |
onSortChange | (sort: SortState) => void | — | — |
selection | Set<string> | — | Controlled multi-selection (set of row keys); omit to manage internally. |
onSelectionChange | (selection: Set<string>) => void | — | — |
selectable | boolean | false | Show the leading select-checkbox column. |
sticky | boolean | false | Stick the header to the top on scroll. |
heat | boolean | false | Tint cells by each column's `heat` accessor (best/worst shading). |
onRowClick | (row: Row) => void | — | — |
empty | ReactNode | — | Empty-state content when there are no rows. |
className | string | — | — |
Own the code: shadcn add copies this component's source into your repo to read and edit directly. Extend without forking — edit the source, use asChild to swap the element, or pass the typed annotations prop for curated data.