New to KendoReactStart a free 30-day trial

Keyboard Navigation

You can enable the keyboard navigation of the Grid with the navigatable prop of the Grid. The navigatable property is set to false by default.

To activate the Grid's keyboard navigation, based on your scenario, pass one of the following options to the navigatable prop:

  • true for all scenarios in which the Grid is not editable or when editing the component's data using an external form.
  • incell when the Grid is configured to work in in-cell editing mode.
  • inline when the Grid is configured to work in inline editing mode.

Keyboard Navigation Without Editing

In order to enable the keyboard navigation over the toolbar of the Grid, you need to use the KendoReact Toolbar that comes with a built-in keyboard support.

Change Theme
Theme
Loading ...

The Grid supports the following keyboard shortcuts:

SHORTCUTDESCRIPTION
Right ArrowMoves the focus one cell to the right. If the focus is on the right-most cell in the row, the focus does not move.
Left ArrowMoves the focus one cell to the left. If the focus is on the left-most cell in the row, the focus does not move.
Down ArrowMoves the focus one cell down. If the focus is on the bottom-most cell in the column, the focus does not move.
Up ArrowMoves the focus one cell up. If the focus is on the top-most cell in the column, the focus does not move.
Page DownScrolls to the next page of data. If paging is configured, loads the next page of data, if any.
Page UpScrolls to the previous page of data. If paging is configured, loads the previous page of data, if any.
HomeMoves the focus to the first focusable cell in the row.
EndMoves the focus to the last focusable cell in the row.
SpaceSelects the row holding the currently focused cell.
Ctrl/Cmd(Mac) & HomeMoves the focus to the first cell in the first row.
Ctrl/Cmd(Mac) & EndMoves the focus to the last cell in the last row.
Ctrl/Cmd(Mac) & SpaceSelects or deselects the current row, while persisting previously selected rows (only for selection mode "multiple").
Shift & SpacePerforms range selection, selects all the rows between the last selected one (with SPACE or mouse click) and the one holding the focused cell.
Shift & Up ArrowSelects the row above. When multiple selection is enabled, extends the selection to that row.
Shift & Down ArrowSelects the row below. When multiple selection is enabled, extends the selection to that row.

The Grid column header cells support the following keyboard shortcuts:

SHORTCUTDESCRIPTION
EnterIf the column is sortable, triggers the action associated with clicking the header cell - either sorts the data by the respective field, changes the sorting direction, or unsorts, depending on current state and configuration.
Alt & Down ArrowOpens the Filter or Column Menu when the respective header cell is focused. Traps the focus within the opened menu container.
Ctrl & Space / Cmd & Enter(MacOS)If the column is groupable, groups/ungroups the data by the column field.
Ctrl/Cmd(MacOS) & RightArrowReorders the column with the next one (if such is available).
Ctrl/Cmd(MacOS) & LeftArrowReorders the column with the previous one (if such is available).

The Grid Filter Menu supports the following keyboard shortcuts*:

SHORTCUTDESCRIPTION
Alt & Down ArrowOpens the Filter Menu when the respective header cell is focused. Traps the focus within the opened menu container.
EscapeCloses the Filter Menu and returns the focus to its parent header cell.
TabMoves the focus to the next focusable menu element. When tabbing out of the last element, the first element is focused.
Shift & TabMoves the focus to the previous focusable menu element. When shift-tabbing out of the first element, the last element is focused.
EnterTriggers filtering by the current criteria and closes the menu when the filter is not empty.

*All inner Filter Menu components follow their own keyboard navigation behavior when focused.

Here is a demo of the Filter Menu with an active keyboard navigation:

Change Theme
Theme
Loading ...

The Grid Column Menu supports the following keyboard shortcuts*:

SHORTCUTDESCRIPTION
Alt & Down ArrowOpens the Column Menu when the respective header cell is focused. Traps the focus within the opened menu container.
EscapeCloses the Column Menu and returns the focus to its parent header cell.
TabMoves the focus to the next focusable menu element. When tabbing out of the last element, the first element is focused.
Shift & TabMoves the focus to the previous focusable menu element. When shift-tabbing out of the first element, the last element is focused.
EnterTriggers the default action, associated with the focused menu item or expands/collapses an expandable item like the Filter, Column Chooser, and Set Column Position items.

* All inner components within the column menu Filter item follow their own keyboard navigation behavior when focused.

The Grid Pager supports the following keyboard shortcuts*:

SHORTCUTDESCRIPTION
EnterWhen the Pager wrapper is focused, moves the focus to the first focusable pager element. When an inner Pager element is focused, triggers the default action, associated with this element.
EscapeWhen an inner Pager element is focused, brings the focus to the Pager wrapper. If the focused inner component has an open popup, Escape will close the popup. Pressing Escape again will focus the Pager wrapper.
TabWhen an inner Pager element is focused, moves the focus between the focusable Pager elements sequentially. The focus is trapped and tabbing out of the last focusable element, focuses the first focusable element.
Shift & TabWhen an inner Pager element is focused, moves the focus between the focusable Pager elements sequentially in reversed order. The focus is trapped and shift-tabbing out of the first focusable element, focuses the last focusable element.
Left Arrow or Page UpWhen the Pager wrapper is focused, loads the previous page of data, if any.
Right Arrow or Page DownWhen the Pager wrapper is focused, loads the next page of data, if any.
HomeWhen the Pager wrapper is focused, loads the first page of data (if the current page is not the first one).
EndWhen the Pager wrapper is focused, loads the last page of data (if the current page is not the last one).

* All inner components within the Pager follow their own keyboard navigation behavior when focused.

The Grid toolbars support the following keyboard shortcuts*:

SHORTCUTDESCRIPTION
Left/Right ArrowFocuses the previous/next focusable element in the toolbar. Focus is wrapped, meaning it will go from the last to first focusable element and vice-versa depending on the end user action.
TabFocuses the next navigable Grid section, or the next focusable element on the page.
Shift + TabFocuses the previous navigable Grid section, or the previous focusable element on the page.

* All inner components within the toolbars follow their own keyboard navigation behavior when focused.

When a Grid cell contains focusable components, the Grid supports the following shortcuts:

SHORTCUTDESCRIPTION
Enter or F2Disables the keyboard navigation of the Grid and places the focus on the first widget.
EscapeRestores the keyboard navigation of the Grid. If the content was in the process of editing, the unsaved edits are removed.
TabMoves the focus to the next focusable component in the current row.
Shift & TabMoves the focus to the previous focusable component in the current row.
Alphanumeric keysIf the cell contains editable content, places the focus in an input field—for example, a textbox.

Keyboard Navigation With Editing

To configure the keyboard navigation of a Grid with enabled data editing, you need to explicitly set the editing type in its navigatable property.

Below you can see keyboard navigation examples of the Grid in the following editing modes:

Inline Editing - Keyboard Navigation

To properly set the keyboard navigation in this editing mode, you need to define the Grid as follows:

jsx
    <Grid
        navigatable={{mode: 'inline' as NavigatableMode }}
        .............
Change Theme
Theme
Loading ...

With the above configuration, the following shortcuts become available when the component enters editing mode:

SHORTCUTDESCRIPTION
TabMoves the cursor to the next editor in the row.
EscapeCancels the row edit.

In-Cell Editing - Keyboard Navigation

To properly set the keyboard navigation in this editing mode, you need to define the Grid as follows:

jsx
    <Grid
        navigatable={{mode: 'incell' as NavigatableMode }}
        .............
Change Theme
Theme
Loading ...

With this configuration, the following shortcuts become available when the component enters editing mode:

SHORTCUTDESCRIPTION
TabMoves to the next editor in the row (closing the current editor).
Shift + TabMoves to the previous editor in the row (closing the current editor).
EnterCommits changes for the edited item, and moves focus to the same cell on the row below, opening it for edit.
EscapeCancels the edit. The focus goes to the current cell.

To properly set the keyboard navigation in this editing mode, you need to define the Grid as follows:

jsx
    <Grid
        navigatable={true}
        .............
Change Theme
Theme
Loading ...

With this configuration, once the external editing form is visible, the first editor in it is focused and the following shortcuts become available:

SHORTCUTDESCRIPTION
TabMoves to the next editor in the form.
Shift + TabMoves to the previous editor in the form.
EnterTriggers a submit action for the editor, including validation.
EscapeCloses the editor. The focus goes to the command cell from where the popup was opened.