Shadcn React Table
A shadcn/ui data table with Material React Table (MRT V3) feature parity, built on TanStack Table v8. It ships as a shadcn registry component — you install the source into your own project with the shadcn CLI, so it inherits your style, base color, and theme tokens and you own every line.
Advanced (kitchen sink)
Drag a column here to group by it
# | ID | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2261 | 45000134754 | 099 | |||||||||||
| 1 | Ava | Thompson | Owner | Engineering | active | 22 | $45,000 | Jan 2, 2023 | 0% | ||||
| 2 | Liam | Nguyen | Admin | Marketing | inactive | 25 | $47,137 | Jan 13, 2023 | 9% | ||||
| 3 | Noah | Silva | Editor | Design | pending | 28 | $49,274 | Jan 24, 2023 | 18% | ||||
| 4 | Emma | Carter | Viewer | Sales | active | 31 | $51,411 | Feb 4, 2023 | 27% | ||||
| 5 | Olivia | Rossi | Owner | Support | inactive | 34 | $53,548 | Feb 15, 2023 | 36% | ||||
| 6 | William | Walker | Admin | Engineering | pending | 37 | $55,685 | Feb 26, 2023 | 45% | ||||
| 7 | Sophia | Patel | Editor | Marketing | active | 40 | $57,822 | Mar 9, 2023 | 54% | ||||
| 8 | James | Muller | Viewer | Design | inactive | 43 | $59,959 | Mar 20, 2023 | 63% | ||||
| 9 | Isabella | Park | Owner | Sales | pending | 46 | $62,096 | Mar 31, 2023 | 72% | ||||
| 10 | Lucas | Reyes | Admin | Support | active | 49 | $64,233 | Apr 11, 2023 | 81% | ||||
| $4,120,536 |
Rows per page
1–10 of 48
Why this table
MRT is the most complete React table, but it's tied to Material UI. This table brings that same breadth of features to the shadcn/ui ecosystem:
- One hook, one component.
useDataTable(options)returns an enriched TanStack instance;<DataTable table={table} />renders it. Everything is driven by options. - Feature-complete. Sorting, per-column filtering with mode menus, fuzzy global search, column ordering / pinning / resizing / visibility, density, sticky header & footer, row selection, row numbers, row pinning, drag-to-reorder rows, grouping with aggregation, detail panels, tree data, inline editing (cell / row / table / modal), row & cell actions, click-to-copy, row & column virtualization, CSV / Excel export, full localization, and swappable icons.
- Style-agnostic. It only uses standard shadcn primitive APIs (
button,table,popover,command, …), declared as registry dependencies.shadcn addinstalls them in your configured style, so the table adopts your look with nothing to override. - You own the source. No opaque dependency — the component lands in your repo under
components/ui/data-table/and is yours to extend.
How it works
It is a thin, opinionated layer over TanStack Table:
- It wraps
useReactTablewith sensible defaults (row models, an auto-injected selection column, localization) and attaches its presentation state + feature flags to the instance astable.cnTable. - Controlled state (
sorting,columnFilters,pagination,rowSelection, …), themanual*server-side flags, andgetRowIdall pass straight through to TanStack. If you know TanStack Table, you already know this table. - The
<DataTable />component readstable.cnTableto render the toolbar, filter row, body, footer, and pagination — no prop drilling.
Next steps
- Installation — add the table to your project via the shadcn registry.
- Quick start — a minimal table in a few lines.
- Usage — the mental model: options in, instance out.
- Guides — one page per feature, each with a live example.
- API reference — every option, prop, and token, generated from the source types.