edbnedbn/uibeta
ComponentsTablesChartsPDFs
GitHub stars
Explorer
    • Welcome
    • Principles
    • Accordion
    • Alert
    • Alert Dialog
    • Aspect Ratio
    • Attachment
    • Avatar
    • Badge
    • Breadcrumb
    • Bubble
    • Button
    • Button Group
    • Calendar
    • Card
    • Carousel
    • Chart
    • Checkbox
    • Collapsible
    • Combobox
    • Command
    • Context Menu
    • Data Table
    • Date Picker
    • Basic
    • Range
    • Date of Birth
    • Input
    • Time
    • Natural Language
    • RTL
    • Dialog
    • Direction
    • Drawer
    • Dropdown Menu
    • Empty
    • Field
    • Form
    • Bug Report
    • Select
    • Checkbox Group
    • Radio Group
    • Switch
    • Complex Form
    • Array Fields
    • Hover Card
    • Input
    • Input Group
    • Input Otp
    • Item
    • Kbd
    • Label
    • Marker
    • Menubar
    • Message
    • Message Scroller
    • Native Select
    • Navigation Menu
    • Pagination
    • Popover
    • Progress
    • Questionnaire
    • Radio Group
    • Resizable
    • Scroll Area
    • Select
    • Separator
    • Sheet
    • Sidebar
    • Skeleton
    • Slider
    • Sonner
    • Spinner
    • Switch
    • Table
    • Tabs
    • Textarea
    • Toast
    • Toggle
    • Toggle Group
    • Tooltip
    • Typeset
    • Documentation
    • Reading
    • Chat / Streaming
    • Element Coverage

Composition recipe

Data Table

Start with native table semantics, then add TanStack Table features as the product needs them.

TanStack Table v9shadcn reference

Installation

Data Table starter

npx shadcn@4.19.0 add https://ui.edbn.me/r/data-table.json

Source

Dependencies

Packages1

  • @tanstack/react-table

Registry items5

  • table
  • checkbox
  • dropdown-menu
  • input
  • pagination

Documentation

Choose the smallest table

Use the Table primitives for fixed markup. Install the Data Table starter when rows need sorting, filtering, pagination, selection, or controlled product state. There is intentionally no universal data table component.

The preview and source above are the same installable TanStack Table v9 starter used by the dedicated Tables Explorer.

Project structure

components/data-table/core/
├── data-table.tsx
├── data-table-features.ts
├── data-table-column-header.tsx
├── data-table-pagination.tsx
├── data-table-toolbar.tsx
└── data-table-view-options.tsx

Column definitions and product data stay with the feature. The copied core owns rendering and reusable controls, without owning a fetch.

Feature model

const features = tableFeatures({
  sorting: true,
  filtering: true,
  pagination: true,
})

const table = useTable({ features, columns, data, getRowId })

Add only the features the current screen exposes. Formatting belongs in column cells; row actions belong in an explicit actions column.

Explore each behavior

  • Basic
  • Sorting
  • Filtering
  • Pagination
  • Selection
  • Visibility
  • Actions
  • Complete
  • States

Data and accessibility

Keep native table semantics, provide a caption and description, use a stable row identifier, and expose row headers through the starter’s isRowHeader callback. For remote data, choose the appropriate data boundary before enabling server-owned state.