Skip to content
Niko Table

Installation

Install DataTable with the shadcn CLI, then add only the features you need.

You need:

  1. A React project (Next.js, Vite, etc.)

  2. Shadcn UI set up in your project (Installation Guide). Radix UI (new-york, radix-*), Base UI (base-*) and React Aria (aria-*, experimental) styles all work.

  3. TailwindCSS configured

  4. TypeScript (recommended)

  5. TanStack Table v9 (@tanstack/react-table@^9). The CLI sets this version when you install registry items. To add it by hand, run:

    pnpm add @tanstack/react-table@^9

Radix UI and Base UI use the same source. React Aria has its own build (see below).

  • Radix style: "new-york" works.
  • Base UI style: "base-nova" works. It is the current shadcn init default.
  • Type errors after install?
    • Update to a recent shadcn CLI.
    • Re-add the block with --overwrite.
  • How it works: The source typechecks against both styles. The CLI swaps Radix idioms for Base UI ones during install (asChild becomes render).

Register the @niko-table/ namespace in your components.json so the shadcn CLI can find it. Add the registries field:

components.json
{
"$schema": "https://ui.shadcn.com/schema.json",
// ... your existing config (style, tailwind, aliases, etc.)
"registries": {
"@niko-table": "https://niko-table.com/r/{style}/{name}.json"
}
}

Tip: Don’t want to edit components.json? Install by URL instead (see the URL commands below).

  • These URLs install the Radix UI and Base UI version.
  • On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/<name>.json. Use the style from your components.json.

The same line works for all three. The CLI reads style in your components.json and gets the matching version.

  • Radix UI (new-york, radix-*) and Base UI (base-*): supported.
  • React Aria (aria-*): new and experimental.
    • It needs the registries line above. Without it, the CLI uses the shadcn directory entry for @niko-table, which installs the Radix version.
    • Known gaps:
      • Popovers, menus and the right-click menu are always modal: the page does not scroll while one is open.
      • Arrow keys do not move between menu items and a search box or other controls inside the same menu. Tab and the mouse do.
      • Right-click menus do not open with a long press on touch, and after one closes, focus goes to the page, not the row.
      • Search in filters and menus matches text that contains what you type. It does not do fuzzy matches, and results keep their order.
      • The first Escape in a search box clears it. The next one closes the popover.
      • In the drag-to-reorder column menu, arrow keys do not move between rows. Tab, Enter and the mouse do.
      • A picked date cannot be cleared by clicking it again, and a date range only reports once both ends are picked.
      • Help icons with a tooltip are an extra Tab stop, and tooltips open on hover only after a first click on the page.
      • shadcn’s React Aria components/ui/label.tsx imports React but never uses it. That fails strict TypeScript (noUnusedLocals). Delete the import line. This is a shadcn issue, not Niko Table.
  • Already using https://niko-table.com/r/{name}.json? It still works on Radix and Base UI. Switch to the line above to get React Aria.

Install in two steps, or all at once:

  1. Install the owner once. @niko-table/data-table copies DataTableRoot, the table chrome, data-table-core and data-table-ui into your project.
  2. Add features one by one. Run the CLI for each feature you need (pagination, search filter, DnD, etc.).
    • Each add-on depends on data-table-core. The CLI installs or reuses it.
    • It does not pull in Root or overwrite table.tsx.

Install the owner now:

pnpm dlx shadcn@latest add @niko-table/data-table

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table.json (use the style from your components.json).

This installs the full table owner (data-table, data-table-core and data-table-ui).

  • Includes lib/data-table-features.ts. This is TanStack Table v9’s feature list. DataTableRoot passes it to useTable.
  • Trim it after install. Remove the features you never use. See Table Features.
  • Need more? Add the optional blocks below one by one, or use Install Everything.
  • Own the TanStack instance? Skip data-table and install the control items directly. See Components.

Want every registry item at once? List them all. The shadcn CLI does not support wildcards like @niko-table/**. Installing only what you need is better (see Components).

pnpm dlx shadcn@latest add @niko-table/data-table @niko-table/data-table-virtualized @niko-table/data-table-pagination @niko-table/data-table-search-filter @niko-table/data-table-sort-menu @niko-table/data-table-view-menu @niko-table/data-table-view-dnd-menu @niko-table/data-table-clear-filter @niko-table/data-table-filter-menu @niko-table/data-table-faceted-filter @niko-table/data-table-inline-filter @niko-table/data-table-slider-filter @niko-table/data-table-date-filter @niko-table/data-table-export-button @niko-table/data-table-aside @niko-table/data-table-selection-bar @niko-table/data-table-column-sort @niko-table/data-table-column-hide @niko-table/data-table-column-pin @niko-table/data-table-column-group @niko-table/data-table-column-resize @niko-table/data-table-column-auto-fit @niko-table/data-table-column-sizing-persistence @niko-table/data-table-column-faceted-filter @niko-table/data-table-column-slider-filter @niko-table/data-table-column-date-filter @niko-table/data-table-row-dnd @niko-table/data-table-column-dnd @niko-table/data-table-virtualized-row-dnd @niko-table/data-table-virtualized-column-dnd @niko-table/data-table-grid @niko-table/data-table-grid-changes

To browse the registry, run:

npx shadcn@latest search @niko-table

Skip the registry setup by passing full URLs. On React Aria, replace /r/ with /r/<your style>/ in each URL (for example /r/aria-nova/data-table.json):

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table.json" "https://niko-table.com/r/data-table-virtualized.json" "https://niko-table.com/r/data-table-pagination.json" "https://niko-table.com/r/data-table-search-filter.json" "https://niko-table.com/r/data-table-sort-menu.json" "https://niko-table.com/r/data-table-view-menu.json" "https://niko-table.com/r/data-table-view-dnd-menu.json" "https://niko-table.com/r/data-table-clear-filter.json" "https://niko-table.com/r/data-table-filter-menu.json" "https://niko-table.com/r/data-table-faceted-filter.json" "https://niko-table.com/r/data-table-inline-filter.json" "https://niko-table.com/r/data-table-slider-filter.json" "https://niko-table.com/r/data-table-date-filter.json" "https://niko-table.com/r/data-table-export-button.json" "https://niko-table.com/r/data-table-aside.json" "https://niko-table.com/r/data-table-selection-bar.json" "https://niko-table.com/r/data-table-column-sort.json" "https://niko-table.com/r/data-table-column-hide.json" "https://niko-table.com/r/data-table-column-pin.json" "https://niko-table.com/r/data-table-column-group.json" "https://niko-table.com/r/data-table-column-resize.json" "https://niko-table.com/r/data-table-column-auto-fit.json" "https://niko-table.com/r/data-table-column-sizing-persistence.json" "https://niko-table.com/r/data-table-column-faceted-filter.json" "https://niko-table.com/r/data-table-column-slider-filter.json" "https://niko-table.com/r/data-table-column-date-filter.json" "https://niko-table.com/r/data-table-row-dnd.json" "https://niko-table.com/r/data-table-column-dnd.json" "https://niko-table.com/r/data-table-virtualized-row-dnd.json" "https://niko-table.com/r/data-table-virtualized-column-dnd.json" "https://niko-table.com/r/data-table-grid.json" "https://niko-table.com/r/data-table-grid-changes.json"

Add only what you need. Each component installs on its own:

DataTablePagination:

pnpm dlx shadcn@latest add @niko-table/data-table-pagination

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-pagination.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-pagination.json (use the style from your components.json).

DataTableSearchFilter:

pnpm dlx shadcn@latest add @niko-table/data-table-search-filter

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-search-filter.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-search-filter.json (use the style from your components.json).

DataTableSortMenu:

pnpm dlx shadcn@latest add @niko-table/data-table-sort-menu

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-sort-menu.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-sort-menu.json (use the style from your components.json).

DataTableViewMenu:

pnpm dlx shadcn@latest add @niko-table/data-table-view-menu

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-view-menu.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-view-menu.json (use the style from your components.json).

DataTableViewDndMenu (column visibility and drag-to-reorder):

pnpm dlx shadcn@latest add @niko-table/data-table-view-dnd-menu

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-view-dnd-menu.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-view-dnd-menu.json (use the style from your components.json).

DataTableClearFilter:

pnpm dlx shadcn@latest add @niko-table/data-table-clear-filter

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-clear-filter.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-clear-filter.json (use the style from your components.json).

DataTableExportButton:

pnpm dlx shadcn@latest add @niko-table/data-table-export-button

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-export-button.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-export-button.json (use the style from your components.json).

DataTableFilterMenu:

pnpm dlx shadcn@latest add @niko-table/data-table-filter-menu

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-filter-menu.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-filter-menu.json (use the style from your components.json).

DataTableFacetedFilter:

pnpm dlx shadcn@latest add @niko-table/data-table-faceted-filter

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-faceted-filter.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-faceted-filter.json (use the style from your components.json).

DataTableInlineFilter:

pnpm dlx shadcn@latest add @niko-table/data-table-inline-filter

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-inline-filter.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-inline-filter.json (use the style from your components.json).

DataTableSliderFilter:

pnpm dlx shadcn@latest add @niko-table/data-table-slider-filter

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-slider-filter.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-slider-filter.json (use the style from your components.json).

DataTableDateFilter:

pnpm dlx shadcn@latest add @niko-table/data-table-date-filter

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-date-filter.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-date-filter.json (use the style from your components.json).

DataTableColumnSort:

pnpm dlx shadcn@latest add @niko-table/data-table-column-sort

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-column-sort.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-column-sort.json (use the style from your components.json).

DataTableColumnHide:

pnpm dlx shadcn@latest add @niko-table/data-table-column-hide

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-column-hide.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-column-hide.json (use the style from your components.json).

DataTableColumnPin:

pnpm dlx shadcn@latest add @niko-table/data-table-column-pin

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-column-pin.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-column-pin.json (use the style from your components.json).

DataTableColumnGroup:

pnpm dlx shadcn@latest add @niko-table/data-table-column-group

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-column-group.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-column-group.json (use the style from your components.json).

DataTableColumnResize:

pnpm dlx shadcn@latest add @niko-table/data-table-column-resize

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-column-resize.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-column-resize.json (use the style from your components.json).

DataTableColumnAutoFit:

pnpm dlx shadcn@latest add @niko-table/data-table-column-auto-fit

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-column-auto-fit.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-column-auto-fit.json (use the style from your components.json).

useColumnSizingPersistence (persist column widths):

pnpm dlx shadcn@latest add @niko-table/data-table-column-sizing-persistence

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-column-sizing-persistence.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-column-sizing-persistence.json (use the style from your components.json).

DataTableColumnFacetedFilter:

pnpm dlx shadcn@latest add @niko-table/data-table-column-faceted-filter

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-column-faceted-filter.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-column-faceted-filter.json (use the style from your components.json).

DataTableColumnSliderFilter:

pnpm dlx shadcn@latest add @niko-table/data-table-column-slider-filter

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-column-slider-filter.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-column-slider-filter.json (use the style from your components.json).

DataTableColumnDateFilter:

pnpm dlx shadcn@latest add @niko-table/data-table-column-date-filter

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-column-date-filter.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-column-date-filter.json (use the style from your components.json).

DataTableVirtualized:

pnpm dlx shadcn@latest add @niko-table/data-table-virtualized

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-virtualized.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-virtualized.json (use the style from your components.json).

DataGrid (editable spreadsheet):

Turns the virtualized table into an editable grid with keyboard navigation and clipboard support. See the Niko Grid docs.

pnpm dlx shadcn@latest add @niko-table/data-table-grid

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-grid.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-grid.json (use the style from your components.json).

Optional change tracking for saves (useGridChanges):

pnpm dlx shadcn@latest add @niko-table/data-table-grid-changes

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-grid-changes.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-grid-changes.json (use the style from your components.json).

DataTableAside:

pnpm dlx shadcn@latest add @niko-table/data-table-aside

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-aside.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-aside.json (use the style from your components.json).

DataTableSelectionBar:

pnpm dlx shadcn@latest add @niko-table/data-table-selection-bar

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-selection-bar.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-selection-bar.json (use the style from your components.json).

DataTableRowDnd:

pnpm dlx shadcn@latest add @niko-table/data-table-row-dnd

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-row-dnd.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-row-dnd.json (use the style from your components.json).

DataTableColumnDnd:

pnpm dlx shadcn@latest add @niko-table/data-table-column-dnd

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-column-dnd.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-column-dnd.json (use the style from your components.json).

DataTableVirtualizedRowDnd (needs virtualized + row-dnd):

pnpm dlx shadcn@latest add @niko-table/data-table-virtualized-row-dnd

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-virtualized-row-dnd.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-virtualized-row-dnd.json (use the style from your components.json).

DataTableVirtualizedColumnDnd (needs virtualized + column-dnd):

pnpm dlx shadcn@latest add @niko-table/data-table-virtualized-column-dnd

Requires the @niko-table registry in your components.json. See the Installation Guide for setup. Or install directly via URL:

pnpm dlx shadcn@latest add "https://niko-table.com/r/data-table-virtualized-column-dnd.json"

On React Aria, put your style in the URL: https://niko-table.com/r/aria-nova/data-table-virtualized-column-dnd.json (use the style from your components.json).

  • Do not combine Row DnD with sorting or filtering.
  • Column DnD is safe with any feature.
  • Row and column packages are separate. Installing one does not copy the other.

DataTable has two layers:

  • Components (data-table-*.tsx in /components): wrappers that get the table from DataTableRoot context through useDataTable(). You do not pass props down. This is the recommended layer.
    • Examples: DataTableSearchFilter, DataTableFilterMenu, DataTableSortMenu, DataTablePagination.
  • Filters (table-*.tsx in /filters): the core pieces. They take a table prop and read the TanStack Table instance (like table.state and table.setGlobalFilter()). You can use them on their own.
    • Examples: TableSearchFilter, TableFilterMenu, TableSortMenu.

Why two layers?

  • DataTable* components: import from their direct paths (e.g. @/components/niko-table/components/data-table-pagination). They work with no setup.
  • Table* filters: import from filters (e.g. @/components/niko-table/filters/table-pagination). Use them to build your own components or manage the table instance yourself.
  • Your control: all filter components use TanStack Table hooks directly.

Learn more in the Introduction.

@niko-table/data-table pulls in @niko-table/data-table-ui. That installs a custom components/ui/table.tsx, which adds these to the default Shadcn table:

  • TableComponent export. A plain <table> without the scroll wrapper. DataTable uses it internally.
  • data-slot attributes on all elements.
  • A focusable scroll container (tabIndex={0}). Keyboard users can focus it and scroll with the arrow keys (WCAG 2.1.1).

Controls that only depend on data-table-core do not install this file. Your customized table.tsx is safe.

  • Want our version? Install @niko-table/data-table-ui yourself.
  • Want to keep yours? That works if it exports TableComponent.

Note: Our table.tsx is 100% backward compatible with existing Shadcn tables. If you already have a table.tsx and install data-table or data-table-ui, the CLI asks before overwriting.

If your UI components live in a non-standard path (e.g., packages/ui/src/components/ instead of src/components/ui/), the shadcn CLI may put table.tsx in the wrong place. This is a known shadcn CLI quirk with registry:ui paths.

Workaround:

  1. After installing, check where table.tsx landed.
  2. If it is in a nested ui/ folder, move it to your real UI components path.
  3. Make sure it exports TableComponent:
// Your existing table.tsx — add this function and export
function TableComponent({
className,
...props
}: React.ComponentProps<"table">) {
return (
<table
data-slot="table"
className={cn("w-full caption-bottom text-sm", className)}
{...props}
/>
)
}
// Add TableComponent to your existing exports
export {
TableComponent,
Table,
TableHeader,
// ... your other exports
}

Prefer to copy the files by hand? See the Manual Installation Guide. It has every component file in one place.

Build a simple table first. Add features later.

  1. Start by defining your data

    This data is a list of users with names and emails.

    components/example-table.tsx
    type User = {
    id: string
    name: string
    email: string
    status: "active" | "inactive"
    }
    const data: User[] = [
    { id: "1", name: "John Doe", email: "[email protected]", status: "active" },
    { id: "2", name: "Jane Smith", email: "[email protected]", status: "active" },
    { id: "3", name: "Bob Johnson", email: "[email protected]", status: "inactive" },
    ]
  2. Define your columns

    Columns say how each field is shown.

    components/example-table.tsx
    import type { DataTableColumnDef } from "@/components/niko-table/types"
    const columns: DataTableColumnDef<User>[] = [
    {
    accessorKey: "name",
    header: "Name",
    },
    {
    accessorKey: "email",
    header: "Email",
    },
    {
    accessorKey: "status",
    header: "Status",
    cell: ({ row }) => (
    <span
    className={
    row.original.status === "active"
    ? "text-success"
    : "text-muted-foreground"
    }
    >
    {row.original.status}
    </span>
    ),
    },
    ]
  3. Build your table

    Put the table together with DataTable components.

    components/example-table.tsx
    import { DataTableRoot } from "@/components/niko-table/core/data-table-root"
    import { DataTable } from "@/components/niko-table/core/data-table"
    import {
    DataTableHeader,
    DataTableBody,
    } from "@/components/niko-table/core/data-table-structure"
    export function ExampleTable() {
    return (
    <DataTableRoot data={data} columns={columns}>
    <DataTable>
    <DataTableHeader />
    <DataTableBody />
    </DataTable>
    </DataTableRoot>
    )
    }

Each example needs different dependencies. Here is the list:

  • @tanstack/react-table@^9
  • Shadcn: table
  • @tanstack/react-table@^9
  • Shadcn: table, button, dropdown-menu
  • @tanstack/react-table@^9
  • Shadcn: table, button, input, dropdown-menu
  • @tanstack/react-table@^9
  • Shadcn: table, button, input, dropdown-menu, popover, command, checkbox, select
  • @tanstack/react-table@^9
  • Shadcn: table, button, checkbox, dropdown-menu
  • @tanstack/react-table@^9
  • Shadcn: table, button, input, dropdown-menu
  • @tanstack/react-table@^9
  • Shadcn: table, button, input, dropdown-menu
  • @tanstack/react-table@^9
  • Shadcn: table, button, input, dropdown-menu
  • Registry: @niko-table/data-table-column-group
  • @tanstack/react-table@^9
  • @tanstack/react-virtual
  • Shadcn: table, button, input, dropdown-menu, scroll-area
  • @tanstack/react-table@^9
  • Shadcn: table, button, input, dropdown-menu, popover, command, checkbox, select, scroll-area, separator, skeleton, tooltip
  • Inline Filters: included in DataTable components (no extra dependencies)
  • Sortable Rows (optional): @niko-table/data-table-row-dnd. It installs its @dnd-kit dependencies for you (built on DiceUI Sortable patterns).
  • @tanstack/react-table@^9
  • nuqs (nuqs.dev): type-safe URL state
  • Shadcn: All components from Advanced Table
  • Inline Filters: included in DataTable components (no extra dependencies)
  • Sortable Rows (optional): @niko-table/data-table-row-dnd. It installs its @dnd-kit dependencies for you (built on DiceUI Sortable patterns).

Some features need extra dependencies:

To keep table state in the URL, install nuqs:

npm install nuqs

nuqs keeps filters, pagination and sorting in sync with the URL.

For drag-and-drop row reordering, install the registry block. It brings its @dnd-kit dependencies:

pnpm dlx shadcn@latest add @niko-table/data-table-row-dnd

See the Row DnD Table example. The sortable parts follow DiceUI Sortable patterns.

After install, your project looks like this:

src/
├── components/
│ ├── ui/ # Shadcn UI components
│ └── niko-table/ # DataTable components
│ ├── core/
│ ├── types/
│ ├── hooks/
│ ├── components/
│ ├── filters/
│ ├── config/
│ └── lib/
└── lib/
└── utils.ts

Render a small table to check that it works:

import { DataTableRoot } from "@/components/niko-table/core/data-table-root"
import { DataTable } from "@/components/niko-table/core/data-table"
import {
DataTableHeader,
DataTableBody,
} from "@/components/niko-table/core/data-table-structure"
const columns = [
{ accessorKey: "name", header: "Name" },
{ accessorKey: "email", header: "Email" },
]
const data = [
{ id: "1", name: "John Doe", email: "[email protected]" },
{ id: "2", name: "Jane Smith", email: "[email protected]" },
]
export function TestTable() {
return (
<DataTableRoot data={data} columns={columns}>
<DataTable>
<DataTableHeader />
<DataTableBody />
</DataTable>
</DataTableRoot>
)
}

DataTable is installed. Try the examples: