@gridkitjs/react v0.4.0
Last updated August 3, 2026
Minor Changes#
-
f30a2a9: The grid is now an ARIA grid a keyboard can navigate. It carries
role="grid"with row and column counts and indices, headers carryscope="col", and one roving tab stop moves cell to cell under the arrow keys, Home, End, Ctrl+Home, Ctrl+End and the page keys.Two changes to what a keyboard already did:
- Tab now passes the whole grid, entering it once instead of stopping on
every resize handle. The handles have left the tab order — a widget under
role="grid"has one tab stop, and a grid of twenty columns previously had twenty. - Keyboard resize moved to
Alt+ArrowLeft/Alt+ArrowRighton the focused header, from the bare arrows on its handle, which the grid now needs for navigation.Ctrl+ArrowLeft/Ctrl+ArrowRightstill reorder.
labelandlabelledBygive the grid its accessible name, without which a screen reader announces only "grid":<DataGridComponent label="Application costs" ... />Reorders and resizes are announced through a live region, so a change with only a visual cue is no longer silent.
- Tab now passes the whole grid, entering it once instead of stopping on
every resize handle. The handles have left the tab order — a widget under
-
f92198e:
DataGridComponenttakesgetRowId, giving each row a stable identity for state keyed by it. Rows are keyed by it rather than by their array position, andcellTemplatereceives it asrowIdalongside aselectedflag.<DataGridComponent dataSource={rows} getRowId={(row) => row.Id} />Without it a row is identified by its position, which is enough for a static grid — so nothing has to change — but ties row state to where a row sits rather than to the row itself.
-
4a92413: Rows, columns and cells can be selected.
selectablesays which and how many of each — off by default, since selection claims the click:<DataGridComponent dataSource={rows} getRowId={(row) => row.Id} selectable={{ rows: "multiple", columns: "multiple", cells: "single" }} onRowSelect={({ row }) => console.log(row.row.Name)} onRowSelectionChange={({ added, removed, selected }) => persist(selected)} />A cell takes
false | "single"rather than a mode of its own — it addresses one value, so there is no range to take.Click replaces, Ctrl-click toggles and Shift-click takes a range; from the keyboard, Space toggles the focused row or column, Enter replaces,
Ctrl+Atakes every row and Escape lets them all go. Rows and cells reportaria-selected, and the gridaria-multiselectable.Thirteen callbacks report it —
onRowSelect,onRowsSelect,onRowDeselect,onRowsDeselectandonRowSelectionChange, the same five for columns, andonCellSelect/onCellDeselect/onCellSelectionChange. Each carries the resolved row, column or cell value rather than a bare id, and all of them are fanned out from one diff, so no two can disagree about what an interaction did.defaultRowSelection,defaultColumnSelectionanddefaultCellSelectionset the starting state.Give
getRowIdalongsideselectablefor data that sorts, filters or pages: without it a row is identified by its position, so a re-sort leaves the same positions selected under different rows.
Patch Changes#
- Updated dependencies [f92198e]
- @gridkitjs/core@0.5.0