// 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.

Install shadcn-table in my app: https://www.shadcn-table.com/SKILL.md
Live demo
Loading table

// theming

Change the theme. Not the table.

Your table automatically adapts to your shadcn/ui theme. No extra configuration or code changes needed.

Loading demo

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 guide
  1. Step 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.json
  2. Step 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' },
      ],
      [],
    );
  3. 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} />;