About the shadcn/ui Table Component

The Table component is part of shadcn/ui — a collection of accessible, copy-paste React components built with Radix UI and Tailwind CSS. Install it with `npx shadcn@latest add table` and copy it directly into your project.

Table Component — Frequently Asked Questions

How do I add sorting to a shadcn Table?

Integrate TanStack Table: use `useReactTable` with `getSortedRowModel()`. Pass column `enableSorting: true` and use `column.getToggleSortingHandler()` on header clicks.

How do I add row selection to a shadcn Table?

Add a checkbox column using TanStack Table's `getIsAllPageRowsSelected()` and `getToggleAllPageRowsSelectedHandler()`. Each row gets `row.getToggleRowSelectedHandler()`.

Can I paginate a shadcn Table?

Yes, use TanStack Table with `getPaginationRowModel()`. Combine with the Pagination component to build a full paginated data table.

Table Component - shadcn/ui Examples | Shadcn Store