Skip to main content

DataGrid

Fixed px width — required for pinned columns to compute offsets cleanly.

Signature
Density
Viewport
Theme follows the navbar ☀/☾ toggle
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.

Import

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
viewsDataGridView[]Named presets shown in the Saved views menu.
onCellEdit(rowKey: React.Key, columnKey: string, value: string) =&gt; void
onRowAction(row: Row) =&gt; void
maxHeightnumberMax body height before the grid scrolls (px). Default 460.
emptyStateReact.ReactNodeCustom node rendered when no rows match.
classNamestring