Skip to content
Alea0.1

Data display

DataGrid

A complete data grid: search, sort, column visibility, density, selection with bulk actions, inline editing, pagination and CSV export.

Ant Design: ProTable

import { DataGrid } from '@alea/ui';

Examples

Everything on

Search, sort, hide columns, change density, select rows for bulk actions, edit names inline, page and export.

Plugin
Kind
Users
Status
Color40Beta
Accessibility437Live
Type834Live
Handoff1,231Live
Icons1,628Live
Tokens2,025Beta
Color2,422Live
Accessibility2,819Live

28 rows

Read only

No selection, no editing, all rows: a sortable, searchable list.

Token
Dark
Light
accent/default#cd57ff#940dc2
text/default#f7f7f7#111011
surface/default#1d1c1b#ffffff
status/success#3ddc84#006535

Props

DataGrid props

A full data grid: search, sort, column visibility, density, selection with bulk actions, inline editing, pagination and CSV export (MUI DataGrid, Ant ProTable).

PropTypeDefaultDescription
aria-labelrequiredstring-Name of the grid for screen readers.
columnsrequiredGridColumn<T>[]-The columns: key, label, and optional format, render, sortable, editable, hidden, align, width.
rowsrequiredT[]-The rows; each needs a unique id.
bulkActions((selected: T[]) => ReactNode)-Toolbar buttons that act on the selected rows.
classNamestring-Extra class names for the root element.
emptyTitleReactNode'Nothing to show'Shown when there are no rows (or none match).
exportNamestring | null'data.csv'File name for Export. Default "data.csv". Leave null to hide Export.
onCellEdit((row: T, key: keyof T, value: string) => boolean | void)-Called when a cell is edited: return false to refuse the value.
pageSizenumber10Rows per page. Default 10; 0 shows all.
selectionMode"single" | "multiple" | "none"'multiple'none, single or multiple row selection. Default multiple.

Accessibility

  • Built on Table: a grid with arrow keys between cells and aria-sort.
  • Editable cells are buttons named "value, edit column of row"; Enter saves, Escape cancels, and a refused value is marked invalid.
  • The toolbar is a named toolbar.

Keyboard

KeyDoes
Arrow keysMove between cells
Enter (on an editable cell)Edits; Enter again saves
EscapeCancels the edit
SpaceSelects the row

Do and don't

Do

  • Mark one column isRowHeader.
  • Return false from onCellEdit to refuse a value.

Don't

  • Don't use it for a few rows: Table is lighter.

In Figma

Data grid template with toolbar, header, rows in three states and pagination.

Tested with axe, keyboard and screen reader roles