Data grid preview

Data grid

A compact spreadsheet-style grid with keyboard navigation, inline edits, range select, sort and undo.

  • Group
    Tables
  • Origin
    Inspired · Original (this library)
  • License
    MIT
  • Added
    Oct 18
npx shadcn@latest add @deank/data-grid

The registry stays private. Install from the repo with a GitHub token — see the README.

Usage

import { DataGrid } from "@/registry/components/data-grid/data-grid";

<DataGrid columns={[/* … */]} rows={[/* … */]} />

Props

PropTypeDefaultDescription
columnsDataGridColumn<Row>[]
rowsRow[]
onRowsChange?(rows: Row[]) => voidCalled with the full next rows after every edit or undo.
label?string"Data grid"Accessible name for the grid.
className?string

When to use

Editable tabular data: spreadsheets, admin tables, inline edits with sorting and range select.

When not to use

Read-only small tables (a plain `<table>` is simpler).

Related

Filter menu · Change summary