Getting Started
Introduction
shadcn-table is a data table for shadcn/ui built on TanStack Table: one command copies the source, one hook turns sorting, filtering and more on.
shadcn-table is a feature-rich data table for shadcn/ui. It covers everything from a simple list to a production data grid.
Motivation
Table libraries come in two kinds:
- Headless, like TanStack Table: all the logic, none of the UI. You build every menu, filter and toolbar.
- Component-based, like AG Grid: all the UI, ready to use. Hard to restyle or change.
shadcn-table combines them: TanStack Table for the logic, shadcn/ui for the UI, all in your codebase.
The goal is ease of use. A full table takes three steps:
- Install: one command adds the table to your project.
- Define columns: describe your data with TanStack Table column definitions.
- Render: pass columns and data to
useShadcnTable.
Install
Run this command in a shadcn/ui project. Its tabs pick your base (Base UI, Radix UI or React Aria) and your package manager. Installation covers the prerequisites and a new project.
pnpm dlx shadcn@latest add https://www.shadcn-table.com/r/base/shadcn-table.jsonSee it
A live demo: sorting, filtering, search, pagination and column hiding, all on by default, with select, range, date and multi-select filters on State, Age, Joined and Status.
Why use it
- Every feature built in: sorting, filtering, grouping, editing, pinning, virtualization and more.
- One hook: turn a feature on with one option on
useShadcnTable. - Follows your theme: uses your shadcn/ui components, colors, radius and dark mode, on Base UI, Radix UI or React Aria: one copy of the table per shadcn base.
- Your code: the CLI copies the source into
components/ui/shadcn-table/. Edit any file. - No ceiling: the full TanStack Table API is on the
tableinstance. - 39 languages: English ships with the table, the other 38 install with one command, for example
pnpm dlx shadcn@latest add https://www.shadcn-table.com/r/base/shadcn-table-locale-de.json. See Localization.