Data Table

A production-grade TanStack Table kit in the shadcn idiom: build a table instance with useReactTable, paint it with DataTable, and compose the toolbar, bulk-action bar, pagination, view options and row actions around it.

$bunx shadcn@latest add @nx-ui/data-table
Registry item

The full kit

Every piece composed: selection column, sortable headers, a faceted status filter with live counts, global search, column visibility, a bulk-action bar on selection, row actions, a filter-following footer total and pagination.

B-2026-011Cardboard finesGreenfield — Bay 1
18.9 t
24.0°C
Intake11 Jul 2026
B-2026-003Cardboard finesHallow Farm — Bay 2
16.3 t
22.1°C
Intake09 Jul 2026
B-2026-005Green wasteRiverside — Windrow 2
44.4 t
64.9°C
Active02 Jul 2026
B-2026-014Green wasteHallow Farm — Bay 4
42.6 t
62.4°C
Active30 Jun 2026
B-2026-013Food wasteHallow Farm — Bay 2
31.8 t
58.1°C
Active24 Jun 2026
B-2026-012Green wasteGreenfield — Windrow 7
55.2 t
41.7°C
Curing10 Jun 2026
499.0 t
16 of 12

Rows per page

Page 1 of 2

Loading & empty states

DataTable owns both non-data states: `isLoading` swaps the body for skeleton rows (tuned with `loadingRowCount`), and an empty result renders `emptyState` — or a sensible default built from the ui/empty primitive.

Loading — isLoading paints skeleton rows
0.0 t
Empty — pass a custom emptyState
No batches yet
Turn your first intake into a windrow to start tracking temperatures and maturation.
0.0 t

Expandable sub-rows

Add the `expandColumn()` factory and pass `renderSubComponent` — expanded rows paint a full-width detail panel on the secondary background, here a per-batch turn-log summary.

B-2026-014Green wasteHallow Farm — Bay 4
42.6 t
62.4°C
Active
B-2026-013Food wasteHallow Farm — Bay 2
31.8 t
58.1°C
Active
B-2026-012Green wasteGreenfield — Windrow 7
55.2 t
41.7°C
Curing
B-2026-011Cardboard finesGreenfield — Bay 1
18.9 t
24.0°C
Intake
B-2026-010Food wasteRiverside — Bay 3
27.3 t
38.9°C
Curing
175.8 t

Pinned columns & row click

TanStack column pinning gets the sticky treatment with an edge hairline: Batch is pinned left, the actions menu right, and the middle scrolls. `onRowClick` fires for the row while ignoring interactive cells.

B-2026-014Green wasteHallow Farm — Bay 4
42.6 t
62.4°C
Active
B-2026-013Food wasteHallow Farm — Bay 2
31.8 t
58.1°C
Active
B-2026-012Green wasteGreenfield — Windrow 7
55.2 t
41.7°C
Curing
B-2026-011Cardboard finesGreenfield — Bay 1
18.9 t
24.0°C
Intake
B-2026-010Food wasteRiverside — Bay 3
27.3 t
38.9°C
Curing
B-2026-009Green wasteHallow Farm — Bay 1
47.5 t
29.6°C
Screening
223.3 t

Click a row (or scroll horizontally — Batch and the actions menu stay pinned).

End-to-end examples

Real domain tables built on this kit live under Tables in the sidebar — invoices (money formatting, density toggle, CSV export), waste movements and organisations.

API reference

Exported parts and their props, extracted from the component source.