Data Display · block · 14K

Data table

A data table on TanStack Table v9 in the Finder list style: click column titles to sort, a filter field, a Columns menu to show and hide columns, check-box row selection with Shift ranges, and a footer reading "12 items · page 1 of 3" with Previous and Next push buttons.

Build columns with createDataTableColumnHelper<Row>(), which is TanStack's createColumnHelper bound to the exported dataTableFeatures. meta.label names a column in the Columns menu; meta.align "end" right-aligns it. Pass getRowId for a selection that survives sorting and paging. Every string is in the labels prop.

Install

pnpm dlx shadcn@latest add @s7ui/data-table

Example

INV-1001Acme SupplyPaid1992-01-01$120.00
INV-1002Blue HarborPending1992-02-06$3,239.25
INV-1003Cedar & Co.Paid1992-03-11$1,558.50
INV-1004Delta PrintOverdue1992-04-16$4,677.75
INV-1005Elm Street BakeryPaid1992-05-21$2,996.00
INV-1006FieldstonePaid1992-06-26$1,315.25
INV-1007Granite LabsPending1992-07-04$4,434.50
INV-1008Harbor LightPaid1992-08-09$2,753.75

24 items · page 1 of 3

Info

Files:
components/retro/data-table.tsx
Uses:
@s7ui/theme, @s7ui/table, @s7ui/bitmap, @s7ui/button, @s7ui/checkbox, @s7ui/input, @s7ui/dropdown-menu, @s7ui/pixel-glyphs
Packages:
@tanstack/react-table