Skip to main content

DataGrid

The workhorse table for ERP / admin surfaces — Table plus a toolbar, filtering, saved views, column management, frozen columns and inline editing.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When to use​

  • Use it when Dense, interactive tabular data: sorting, filtering, saved views, selection, inline edit.
  • Reach for something else when A simple read-only list — use Table.

Accessibility​

Semantic table with column headers, aria-sort on sortable columns, keyboard-reachable filters, selection and inline edit.

Install and import​

npx shadcn@latest add @prism/data-grid
import { DataGrid } from '@/components/prism/DataGrid';

In a no-build prototype, read it from the bundle instead: const { DataGrid } = window.PrismDesignSystem_39d121;

Examples​

Saved views + selection

<DataGrid columns={columns} rows={rows} getRowKey={(r) => r.id}
isSelectable views={views} maxHeight={420} onCellEdit={save} />

Status cell renderer

{ key: "status", header: "Status",
render: (r) => <Badge tone={toneFor(r.status)}>{r.status}</Badge> }

Props​

PropTypeRequiredDescription
columnsDataGridColumn&lt;Row&gt;[]Yes
rowsRow[]Yes
getRowKey(row: Row, index: number) =&gt; React.Key—
density"comfortable" | "compact"—
isSelectableboolean—
isSearchableboolean—Show the built-in global search box. Default true. Set false when the grid sits under a page-level search so two inputs do not narrow one list.
viewsDataGridView[]—Named presets shown in the Saved views menu.
onCellEdit(rowKey: React.Key, columnKey: string, value: string) =&gt; void—
onRowAction(row: Row) =&gt; void—
maxHeightnumber—Max body height before the grid scrolls (px). Default 460.
emptyStateReact.ReactNode—Custom node rendered when no rows match.
groupBystring | null—Initial grouping column key.
groupableColumnsstring[]—Column keys offered in the Group menu. Omit to hide the menu.
aggregatesRecord&lt;string, DataGridAggregate&lt;Row&gt;&gt; | null—Per-column aggregation, shown in a sticky footer row and in each group header.
bulkActionsDataGridBulkAction&lt;Row&gt;[]—Actions shown in the floating bar while rows are selected.
classNamestring—