Skip to content
caliper ui pro docs

Data grid

A spreadsheet-style grid with editable cells and formulas.

Pro
A1
RowABCDEFG
1Budget lineOctoberNovemberDecemberQuarterShare %
2Salaries84,00084,00086,500254,50063.28
3Cloud hosting12,40013,15014,90040,450
4Software licences6,2006,2006,90019,300
5Marketing9,50015,20011,80036,500
6Travel2,1003,4005,20010,700
7Office4,3004,3004,30012,900
8Contractors7,8009,1006,40023,300
9Training8001,5002,2004,500
10
11Total127,100136,850138,200402,150
12Monthly average15,887.517,106.2517,275134,050
13
14

When to use

  • Users enter and edit tabular numbers directly.
  • Totals must update as cells change.

When not to use

  • Read-only data; use the data table.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/data-grid

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

DataGrid

7 props
PropTypeDefaultDescription
label *string—
value *Readonly<Record<string, string>>—
onValueChange *(value: Readonly<Record<string, string>>) => void—
rowsnumber20
columnsnumber8
columnLabelsreadonly string[]—Replaces the A, B, C headings.
classNamestring—

Keyboard

↓
Moves to the next item or value.
↑
Moves to the previous item or value.
→
Moves to the next item or value.
←
Moves to the previous item or value.
PageDown
Moves by a larger step, or to the next page.
PageUp
Moves by a larger step, or to the previous page.
Home
Jumps to the first item or the minimum.
End
Jumps to the last item or the maximum.
Tab
Moves focus through the part's focusable elements.
Enter
Activates the focused control.
Delete
Removes the next character or the selected item.
Backspace
Removes the previous character or item.
Escape
Closes or cancels, then returns focus to where it came from.

Accessibility

It exposes grid, gridcell and status semantics, with aria-label, aria-rowcount, aria-colcount, aria-multiselectable, aria-selected and aria-hidden kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/data-grid.md

The index of every part is at /llms.txt.

More in Dense data