// The open-source shadcn data table for React, built on TanStack Table.
shadcn-table
A production-ready data table library built with TanStack Table and shadcn/ui. Sorting, filtering, pagination, grouping, pinning, virtualization, and more, all built in.
// theming
Change the theme. Not the table.
Your table automatically adapts to your shadcn/ui theme. No extra configuration or code changes needed.
Features
Everything you need. Built in.
Sorting, filtering, grouping, editing, virtualization, and more. All built in, fully customizable, and ready to use.
All feature guides- SortingClick a header to sort; shift-click to sort by several.
- FilteringText, select, range and date filters per column.
- Column pinningKeep key columns stuck left or right while you scroll.
- GroupingGroup rows by any column and aggregate the rest.
- VirtualizationRender only the rows on screen, even with 10,000.
- EditingEdit in a cell, a row, a modal or the whole table.
- Row selectionCheckbox or click to select one row or many.
- Detail panelExpand a row to show anything you render.
- ExportSend the rows you see to CSV or PDF.
- Column resizingDrag a column edge to set its width.
- Column orderingDrag headers to put columns in any order.
- LocalizationEvery built-in string translated, RTL included.
Install
Up and running in three steps.
Add the components, define your columns, and render your table. That's all it takes to get started.
View usage guideStep 01
Install
Run a single command to add the table components directly to your project.
pnpm dlx shadcn@latest add https://www.shadcn-table.com/r/base/shadcn-table.jsonStep 02
Define columns
Describe how your data should be displayed using TanStack Table column definitions.
const columns = useMemo<ST_ColumnDef<Person>[]>( () => [ { accessorKey: 'name', header: 'Name' }, { accessorKey: 'age', header: 'Age' }, ], [], );Step 03
Render
Pass in your columns and data. Your table is ready to use.
import { ShadcnTable, useShadcnTable, } from '@/components/ui/shadcn-table'; const table = useShadcnTable({ columns, data }); return <ShadcnTable table={table} />;