Shadcn React Table

Search documentation

Search the docs

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)
GitHub
Drag a column here to group by it
#
ID
2261
45000134754
099
1AvaThompsonOwnerEngineeringactive22$45,000Jan 2, 2023
0%
2LiamNguyenAdminMarketinginactive25$47,137Jan 13, 2023
9%
3NoahSilvaEditorDesignpending28$49,274Jan 24, 2023
18%
4EmmaCarterViewerSalesactive31$51,411Feb 4, 2023
27%
5OliviaRossiOwnerSupportinactive34$53,548Feb 15, 2023
36%
6WilliamWalkerAdminEngineeringpending37$55,685Feb 26, 2023
45%
7SophiaPatelEditorMarketingactive40$57,822Mar 9, 2023
54%
8JamesMullerViewerDesigninactive43$59,959Mar 20, 2023
63%
9IsabellaParkOwnerSalespending46$62,096Mar 31, 2023
72%
10LucasReyesAdminSupportactive49$64,233Apr 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 add installs 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 useReactTable with sensible defaults (row models, an auto-injected selection column, localization) and attaches its presentation state + feature flags to the instance as table.cnTable.
  • Controlled state (sorting, columnFilters, pagination, rowSelection, …), the manual* server-side flags, and getRowId all pass straight through to TanStack. If you know TanStack Table, you already know this table.
  • The <DataTable /> component reads table.cnTable to 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.