Data Table
A TanStack Table data table with sorting, filtering, row selection, pagination, and column visibility, built on Table.
| Actions | |||||
|---|---|---|---|---|---|
| INV-1042 | Paid | Acme Inc.billing@acme.com | $1,200.00 | ||
| INV-1043 | Overdue | Globexap@globex.com | $860.00 | ||
| INV-1044 | Pending | Initechfinance@initech.com | $2,450.00 | ||
| INV-1045 | Paid | Umbrellapay@umbrella.co | $640.50 | ||
| INV-1046 | Draft | Hooliinvoices@hooli.xyz | $3,100.00 |
0 of 10 selectedPage 1 of 2
When to use
- Use when
- Rows people need to sort, select, and page through, such as invoices or users.
- Avoid when
- The data is short and read-only, use Table. Thousands of rows that should scroll instead of page, use Data Table Virtual.
Installation
The source lands in src/components/ui/data-table.tsx, along with any Shelf items it builds on, and .shelf/lock.json records what was installed. It's yours to edit.
Built on
Verified
- Size
- 3.1 kB gzipped on its own, 73 kB with the Shelf items and packages it builds on. JS and CSS in a production build, without React.
- Accessibility
- Axe passes on 6 stories
- Behavior
- 6 interaction tests in Storybook
- Rendering
- Parent re-renders skip its consumers
- React Doctor
- React Doctor finds nothing