@adapttable/shadcn
v2.1.1
Published
shadcn/ui adapter for AdaptTable — a fully-styled React data table in one import, built on the headless @adapttable/core engine and shadcn's design tokens.
Maintainers
Readme
@adapttable/shadcn
📖 Documentation · 🚀 Live demo · Get started · ⚡ Try in StackBlitz
The shadcn/ui adapter for AdaptTable —
a fully-styled React data table in one import, with sorting, filtering,
URL-synced state, selection + bulk actions, column management, RTL, and dark
mode. It's a thin wrapper over @adapttable/unstyled that applies the shadcn
class preset for you, built on the headless @adapttable/core engine.
pnpm add @adapttable/shadcn @adapttable/core react react-domRequires shadcn/ui set up in your app (its CSS variables + Tailwind config) — this adapter only references shadcn's design tokens (
bg-card,text-muted-foreground,border-border,bg-primary, …).The preset ships utility classes in this package, so let Tailwind scan it or they won't compile. In Tailwind v4, add it as a source in your CSS:
@source "../node_modules/@adapttable/shadcn/dist/**/*.js";
Quickstart
import { DataTable, useFrontendData, type ColumnDef } from "@adapttable/shadcn";
interface Person {
id: string;
name: string;
city: string;
}
const columns: ColumnDef<Person>[] = [
{ key: "name", header: "Name", accessor: (r) => r.name, sortable: true },
{ key: "city", header: "City", accessor: (r) => r.city },
];
export function People({ data }: { data: Person[] }) {
const source = useFrontendData<Person>({ data, columns });
return <DataTable source={source} columns={columns} rowKey={(r) => r.id} />;
}That's it — a styled shadcn table, no class wiring. Swap useFrontendData for
useQuerySource to drive it from a server-paginated query; the component doesn't
change.
Features
- Automatic mobile cards — below the mobile breakpoint every row renders as a shadcn-styled card (same filters, search, selection and URL state) and infinite scroll replaces the pager; tune per column with
mobileLabel/hideOnMobile, pin either layout withforceMobile. See it flip live. - Client or server data through one
TableSourcecontract — same props either way. - URL-synced search / sort / filters / page — shareable, deep-linkable links.
- Sorting via sortable headers.
- Filtering — a
SheetorPopoverof filters plus removableBadgechips, with a filter count on the trigger. - Selection + bulk actions using shadcn
Checkboxes, with confirm dialogs (bulkActions). - Row actions with optional confirm,
isHidden/isDisabledper row. - Row expansion — inline detail panels via
renderRowDetail. - Inline cell editing (
onCellEdit+editablecolumns) — text, number and select editors; Enter commits, Escape cancels, Tab moves on. Omit the handler and no cell opens. - Row grouping (
groupBy) with per-group aggregates sharing thesummaryRowmapper. - Column management — show/hide, reorder, pin (sticky) and resize, from a built-in menu.
- Saved views — name a filter/sort/column arrangement and switch between them.
- CSV export (
exportCsv) — current page or the full filtered set. - Virtualization (
virtualize) — opt-in row/card windowing for very large lists. - Pagination — numbered pagination, or infinite scroll (auto by device).
- States —
Skeletonloading, error with retry, and an empty state. - RTL via
dir; dark mode via your Tailwinddark:class strategy. - Customisation — the components are copied into your project — edit them directly, plus
slots,className, injectableconfirm, and the full headless escape hatch via@adapttable/core.
Customizing
Restyle any part by passing your own classNames — they're merged over the
preset, per part, so you only override what you name:
<DataTable
source={source}
columns={columns}
rowKey={(r) => r.id}
classNames={{ root: "rounded-2xl border-2 border-primary" }} // only the root changes
/>Need the raw class map (e.g. to spread into your own @adapttable/unstyled
table)? It's exported:
import { shadcnClassNames } from "@adapttable/shadcn";See it work
Each clip is the real adapter, recorded on the live demo.
Row grouping — group rows by a column with per-group subtotals

Inline cell editing — double-click a cell; text, number and select editors

Filtering — type a bound and the table answers as you type

Column management — show, hide, reorder, pin and resize

RTL / Arabic — the whole table mirrors, not just the text

Documentation
Getting started · Live demo · Comparison vs ag-Grid · MUI X · TanStack
- Data — client vs server tiers · pagination & infinite scroll · URL-synced state
- Interaction — filtering · sorting · selection & bulk actions · row expansion · inline cell editing
- Columns — show/hide · reorder · pin · resize · row grouping & aggregates · CSV export
- More — i18n & RTL · virtualization · customization · API · FAQ
