Skip to content
Projets

Semkoo/niko-table-registry

Voir sur GitHub

À propos

Composable, accessible React data tables for shadcn/ui, built on TanStack Table. Sorting, filters, editable grid and virtualization for 500,000+ rows, in code you own.

Développement web et applicatif

Comment ces chiffres sont mesurés

What you can do

  • Sorting (single / multi-column) and column menus
  • Filtering: global search, faceted, date, slider, inline, AND/OR logic
  • Pagination (client and server-side)
  • Row selection, expansion, context menus

Progression mesurée des étoiles

in 24h
0
in 7 days
Historique en cours
in 15 days
Historique en cours
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

Niko Table

Nobody's table, everyone's solution.

A shadcn-compatible React data table registry built on TanStack Table and shadcn/ui. Not an opaque npm package: you copy the source into your project and own it.

Open code you can read, change, and ship. Same model as shadcn/ui.

Docs: niko-table.com

What you get

  • Data Table: composable DataTable* pieces for sorting, filtering, pagination, selection, expansion, pinning, virtualization, export, and more
  • Niko Grid: optional editable spreadsheet layer (useDataGrid + <DataGrid>) with clipboard, fill, undo/redo, typed editors, and persistence helpers
  • Registry install: add @niko-table once, then install only the blocks you need via the shadcn CLI
  • Works with Radix UI, Base UI and React Aria: like shadcn/ui, the CLI installs the version that matches your project's style

Principles

Open Code. The top layer of component code is yours to modify. Full TypeScript source, not a black box.

Composition. Build tables from small, predictable pieces. Start with DataTableRoot, add header/body, then mount filters, pagination, or grid features as you need them.

Distribution. Flat registry files + the shadcn CLI. One components.json entry, then install by name.

Beautiful Defaults. Sensible styles via shadcn/ui and Tailwind CSS, so defaults look good without a design pass.

AI-Ready. Clean, documented TypeScript that LLMs can read and improve. No hidden abstractions or private APIs.

Features

Table

  • Sorting (single / multi-column) and column menus
  • Filtering: global search, faceted, date, slider, inline, AND/OR logic
  • Pagination (client and server-side)
  • Row selection, expansion, context menus
  • Column pinning, visibility, resize, and DnD reorder
  • Virtual scrolling for large client-side datasets
  • CSV export, aside panels, tree tables
  • Optional URL state with nuqs

Niko Grid

  • Editable cells with typed editors (text, number, checkbox, date, select)
  • Keyboard nav, selection, clipboard, fill handle, undo/redo
  • Opt-in children only: unmounted features attach no listeners
  • Inline validation and create/update/delete change-sets

Quality

  • Full TypeScript
  • Accessible patterns via shadcn primitives (Radix UI, Base UI or React Aria), ARIA in filters/menus, keyboard shortcuts; jsx-a11y in this repo (verify complex tables in your app)
  • Responsive scroll container with touch-friendly controls

Quick Start

1. Add the registry

Merge into your project's components.json:

{
  "registries": {
    "@niko-table": "https://niko-table.com/r/{style}/{name}.json"
  }
}

2. Install a block

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

URL fallback (no components.json change):

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

The CLI does not support wildcards like @niko-table/**. List items explicitly or use Install Everything.

See Installation and Components for the full catalog (pagination, filters, virtualization, DnD, Niko Grid, …).

Manual installation

Copy files from src/components/niko-table/ into your app. Guide: Manual Installation.

Dependencies

npm install @tanstack/react-table

Optional:

# Virtual scrolling
npm install @tanstack/react-virtual

# URL state
npm install nuqs

# Row / column drag-and-drop
npm install @dnd-kit/core @dnd-kit/sortable @dnd-kit/modifiers @dnd-kit/utilities

Usage

Import from direct file paths (no barrel index re-exports for UI components):

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" },
]

export function SimpleTable({ data }) {
  return (
    <DataTableRoot data={data} columns={columns}>
      <DataTable>
        <DataTableHeader />
        <DataTableBody />
      </DataTable>
    </DataTableRoot>
  )
}

Add features by mounting more pieces under DataTableRoot:

import { DataTableToolbarSection } from "@/components/niko-table/components/data-table-toolbar-section"
import { DataTableSearchFilter } from "@/components/niko-table/components/data-table-search-filter"
import { DataTableFilterMenu } from "@/components/niko-table/components/data-table-filter-menu"
import { DataTableViewMenu } from "@/components/niko-table/components/data-table-view-menu"
import { DataTableSortMenu } from "@/components/niko-table/components/data-table-sort-menu"
import { DataTablePagination } from "@/components/niko-table/components/data-table-pagination"

export function AdvancedTable({ data, columns }) {
  return (
    <DataTableRoot
      data={data}
      columns={columns}
      config={{
        enablePagination: true,
        enableFilters: true,
      }}
    >
      <DataTableToolbarSection className="justify-between">
        <div className="flex gap-2">
          <DataTableSearchFilter />
          <DataTableFilterMenu />
        </div>
        <div className="flex gap-2">
          <DataTableViewMenu />
          <DataTableSortMenu />
        </div>
      </DataTableToolbarSection>

      <DataTable>
        <DataTableHeader />
        <DataTableBody />
      </DataTable>

      <DataTablePagination />
    </DataTableRoot>
  )
}

Need an editable spreadsheet? Start with the Niko Grid introduction.

Architecture

Two layers (one-way dependency: shared → niko-table → registry → docs):

Components (/components/, DataTable* prefix): context-aware wrappers that call useDataTable(). Zero prop drilling; recommended for most apps.

<DataTableSearchFilter /> {/* table from DataTableRoot context */}

Filters (/filters/, Table* prefix): accept a table prop. Use when you manage the TanStack instance yourself or build custom wrappers.

<TableSearchFilter table={table} />
niko-table/
├── core/          # DataTableRoot, DataTable, structure (incl. virtualized / DnD)
├── components/    # Context-aware DataTable* wrappers
├── filters/       # Direct-prop Table* primitives
├── grid/          # Niko Grid (useDataGrid, DataGrid, cells, features)
├── hooks/         # Table and grid hooks
├── config/        # Feature detection
├── lib/           # Utilities, constants, formatting
└── types.ts       # TypeScript types

Documentation

Interactive docs and examples: niko-table.com

Getting started

Table examples

Niko Grid

Development

Prerequisites

  • Node.js 22+ (see .nvmrc)
  • pnpm (recommended) or npm

Setup

git clone https://github.com/Semkoo/niko-table-registry.git
cd niko-table-registry
pnpm install
cp .env.example .env
pnpm dev

Docs site: http://localhost:4321.

Build the registry

pnpm registry:build

Install from a local registry:

npx shadcn@latest add http://localhost:4321/r/data-table.json

Contributing

See CONTRIBUTING.md and:

Credits

Built on excellent open-source work:

License

MIT

Explorer des projets similaires

Chargement…