Data grid
ProSpreadsheet-style editing, virtualized both ways, with typed editors, validation, keyboard ranges, and copy and paste. Not an M3 component (@windmorph/react-pro).
import { DataGrid } from '@windmorph/react-pro/data-grid';Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.
Keyboard
| Key | Action | Where |
|---|---|---|
| Tab | Moves into and out of the grid, which is one tab stop. | |
| Arrow keys | Move between cells, including headers and row headers. | |
| Page Up or Page Down | Move by a screenful of rows. | |
| Home or End | Move to the row’s start or end. | |
| Ctrl + Home or Ctrl + End | Move to the grid’s first or last cell. | |
| Shift + Arrow keys | Extends the selected range. | |
| Enter or F2 | Edits the cell; on a row header, moves to its controls. | |
| Enter or Tab | Commits and moves down or across.While editing | While editing |
| Escape | Cancels an edit, or clears the range. | |
| Delete or Backspace | Clears the selected cells. | |
| Ctrl + A | Selects every cell. | |
| Ctrl + C or Ctrl + V | Copy and paste as tab-separated text. |
- Typing starts an edit with the key typed.
- Left and Right mirror in right to left.
Screen reader
- Role
- A
gridwithrow,columnheader,rowheaderandgridcell, witharia-rowindexandaria-colindexon each. - Accessible name
- From
aria-labeloraria-labelledby, which the types require. - States announced
aria-rowcountandaria-colcountcarry the true size. Cells exposearia-selected,aria-invalidandaria-readonly, and an invalid cell is described by its message.
- A cell’s state is an icon named by its label, so colour is never alone.
- Validation messages and pastes are announced in a polite live region.
Focus
- The active cell keeps focus and the tab stop when it scrolls out of the rendered window.
- If rows or columns shrink under it, the active cell moves to one that exists.
- A finished edit returns focus to the cell, or the next one.
Touch target
- Rows are 48px tall at density 0 and lose 4px a density step.
- Editing happens in a field that fills the cell.
Motion
None. Nothing in the grid moves; its rows scroll with the page’s own scrolling.
What you need to do
- Give the grid a name, and every column a non-empty
header. - Set a
validatemessage that says how to put the value right. - Give every state from
getCellStatealabel. - Keep
rowsandonCellChangein step: the grid holds no data of its own.