Aliases
grid, cell navigation table
components / datagridlite
Grid-semantics data surface with cell focus, pinned leading columns, and shared sorting/selection behavior with Table.
Playground
Start here. Switch systems, interact with the shipped component, and let the rest of the page answer the why and how after the behavior clicks.
Cobalt
The crisp default DK action system: bright primary, roomy spacing, and a direct editorial rhythm.
Keyboard-navigable grid with pinned selection and active-cell focus.
| Lumen | $860k | Watch | Rafi | |
| Quartz | $640k | At risk | Mara | |
| Atlas | $1.2M | On track | Nina |
Overview
This section explains the intent of the component before the implementation details.
Aliases
grid, cell navigation table
Explore the math
Layout and Composition,Contrast and Distinctness,Proof System
Decision guide
Use these notes to decide quickly whether this is the right DK component for the job.
Decision guide
Do
Do not
Usage
Prefer these situations when choosing this component.
Usage
These patterns are better served by a different component or a simpler surface.
Anti-patterns
Migration notes
Anatomy
The anatomy explains which pieces matter to the recipe and accessibility model.
grid scroll region
shellOverflow shell for the grid surface.
column header row
headerColumn names and sort controls.
grid cell
cellFocusable cell surface within the grid.
API
The docs contract distinguishes props, DOM events, and slots so integration behavior is explicit.
Props
| Name | Type | Default | Description |
|---|---|---|---|
columns | TableColumn[] | — | Column definitions shared with the broader table model. |
rows | TableRow[] | — | Grid rows, each with a stable id. |
caption | string | — | Visible grid caption. |
description | string | — | Supporting context for the grid. |
size | 'sm' | 'md' | 'md' | Chooses grid density. |
sortable | boolean | false | Enables sortable headers. |
selectable | boolean | false | Shows row selection checkboxes. |
pinnedColumns | number | 0 | Number of leading columns pinned during horizontal scroll. |
activeCell | { row: number; col: number } | — | Controlled active cell coordinates. |
sortBy | string | — | Controlled active sort key. |
sortDirection | 'asc' | 'desc' | 'asc' | Controlled sort direction. |
selectedRowIds | string[] | — | Controlled selected row ids. |
onActiveCellChange | (detail: { activeCell: { row: number; col: number } }) => void | — | Callback fired when the focused cell changes. |
onSortChange | (detail: { sortBy: string; sortDirection: "asc" | "desc" }) => void | — | Callback fired when sorting changes. |
onSelectionChange | (detail: { ids: string[] }) => void | — | Callback fired when row selection changes. |
theme | ThemeContract | — | Overrides the compiled DK theme used to resolve tokens and recipes for this component. |
Events
| Name | Payload | Description |
|---|---|---|
activecellchange | { activeCell: { row: number; col: number } } | Fires when the active cell changes. |
sortchange | { sortBy: string; sortDirection: "asc" | "desc" } | Fires when sorting changes. |
selectionchange | { ids: string[] } | Fires when row selection changes. |
Slots
| Name | Description |
|---|---|
default | DataGridLite is data-driven in v1 and does not expose custom cell slots. |
Recipes
These notes summarize the intended recipe surface rather than exposing raw implementation detail first.
Variants
Sizes
States
Accessibility
This is the behavior the component promises to assistive tech and keyboard users today.
Semantics
Keyboard
Screen readers
Checklist
Implementation
This section shows the representative compiled slot variables that the runtime consumes for the selected design system.
Implementation notes
Implementation checklist
Examples
Each example is intentionally practical, grouped by starter, common pattern, and edge-case coverage.
Starter
1 example
starter
Starter: cell-focused data reviewA keyboard-friendly grid for structured review work.
Copy snippet
<DataGridLite columns={columns} rows={rows} caption="Release grid" sortable={true} />Common patterns
1 example
common
Common: pinned leading columnKeep the identity column visible while moving through wider data.
Copy snippet
<DataGridLite columns={columns} rows={rows} pinnedColumns={1} selectable={true} />Edge cases
1 example
edge
Edge: controlled active cellControl the active cell when the broader app coordinates keyboard focus or companion panels.
Copy snippet
<DataGridLite columns={columns} rows={rows} activeCell={activeCell} onActiveCellChange={(detail) => activeCell = detail.activeCell} />Verification
Proofs stay visible in the docs so the system shows what it can guarantee, not just what it can render.
size=md
size=sm
size=md