Accessibility

DataGrid keyboard navigation, ARIA attributes, and screen reader support

Focus model

By default, rows are the focus targets: Tab moves focus to the first row and arrow keys move it between rows. With withCellSelection, cells are the focus targets. The list view always uses the row model.

Keyboard navigation

Row focus model:

KeyAction
TabMoves focus into the grid and out of it
ArrowDown / ArrowUpMove focus to the next / previous row
Home / EndMove focus to the first / last row
EnterCalls onRowClick, toggles an expandable or group row, starts editing of an editable row
F2Starts editing of the focused row
SpaceToggles selection of the focused row with selectOnRowClick, toggles a group row
Shift + SpaceExtends the selection range with selectOnRowClick
EscapeBlurs the focused row

Cell focus model (withCellSelection):

KeyAction
Arrow keysMove the focused cell and start a new range there
Shift + ArrowExtends the current range
Enter / F2Starts editing of the focused cell
TabMoves focus into the grid (the last focused cell) and out of it

Editing:

KeyAction
EnterValidates and saves the changes
EscapeCancels editing
Tab / Shift + TabMoves between the editors of the row in row editing mode

Header:

KeyAction
TabMoves between sortable headers, column menu buttons and other header controls
Enter / SpaceToggles sorting, opens the column menu
EscapeCancels an active column drag

With withColumnReorder and withColumnMenu, the Move left and Move right menu items reorder columns from the keyboard. Keys pressed inside controls within a row (checkboxes, buttons, editors) are not handled by the row.

ARIA attributes

  • Sortable headers have aria-sort, group rows and expand toggles have aria-expanded
  • Checkboxes, expand toggles and the column menu button are labelled with the labels prop values, translate them for your users
  • The default editor is labelled with the column label. Use getColumnLabel(cell.column) to get the same label in a custom editComponent
  • The row reorder grip is pointer-only and hidden from assistive technology
  • The grid has aria-busy while loading is set, a row with a pending async save has aria-busy, invalid editor cells have aria-invalid
  • The virtualized body uses role="grid" with aria-rowcount, aria-rowindex and aria-colindex

Focus management

  • When editing ends, focus returns to the row or to the cell. The default editor is focused and its content is selected when editing starts
  • In virtualized mode, rows that scroll out of view are unmounted. Move focus with the arrow keys to keep it inside the rendered rows

Screen readers

The table body renders semantic table elements, the virtualized body relies on the ARIA grid roles listed above. The footer status text, the row count and the selection bar count are not live regions.