Keyboard Navigation

The keyboard navigation of the Menu is always available.

The Menu supports the following keyboard shortcuts:

SHORTCUT DESCRIPTION
Up Arrow
  • (For root items) Opens the item and focuses the last child.
  • (For child items) Focuses the previous item.
Down Arrow
  • (For root items) Opens the item and focuses the first child.
  • (For child items) Focuses the next item.
Left Arrow
  • (For root items) Focuses the previous item.
  • (For child items) For direct children of a root item, opens the previous root item and focuses its first child. Otherwise, closes and focuses the parent.
Right Arrow
  • (For root items) Focuses the next item.
  • (For child items) If the item has children, opens the item and focuses the first child. Otherwise, opens the next root item and focuses its first child.
Home Focuses the first item.
End Focuses the last item.
Enter Selects the focused item. If the item has children, opens the item and focuses the first child. If the item does not have children and has a URL, navigates to the specified URL.
Space Selects the focused item. If the item has children, opens the item and focuses the first child. If the item does not have children and has a URL, navigates to the specified URL.
Escape (For child items) Closes and focuses the parent.
Alphanumeric character Focuses the next item with text starting with the character.
import React from 'react';
import ReactDOM from 'react-dom';
import { Menu } from '@progress/kendo-react-layout';
import items from './items.json';

class App extends React.Component {
    render() {
        return (
            <div>
                <Menu items={items} />
            </div>
        );
    }
}

ReactDOM.render(
    <App />,
    document.querySelector('my-app')
);
[{
    "text": "Item1",
    "items": [{ "text": "Item1.1" }, { "text": "Item1.2", "items": [{ "text": "Item1.2.1" }, { "text": "Item1.2.2" }] }]
}, {
    "text": "Item2",
    "items": [{ "text": "Item2.1" }, { "text": "Item2.2" }, { "text": "Item2.3" }]
}, {
    "text": "Item3"
}]

If the Menu is vertical, the arrow keys perform the following actions:

SHORTCUT DESCRIPTION
Up Arrow Focuses the previous item.
Down Arrow Focuses the next item.
Left Arrow
  • (For root items) opens the item and focuses the last child.
  • (For child items) closes and focuses the parent.
Right Arrow If the item has children, opens the item and focuses the first child. For child items without children, opens the next root item and focuses its first child.
import React from 'react';
import ReactDOM from 'react-dom';
import { Menu, MenuItem } from '@progress/kendo-react-layout';

class App extends React.Component {
    render() {
        return (
            <Menu vertical={true} style={{ display: 'inline-block' }}>
                <MenuItem text="Item1">
                    <MenuItem text="Item1.1" />
                    <MenuItem text="Item1.2">
                        <MenuItem text="Item1.2.1" />
                        <MenuItem text="Item1.2.2" />
                    </MenuItem>
                </MenuItem>
                <MenuItem text="Item2">
                    <MenuItem text="Item2.1" />
                    <MenuItem text="Item2.2" />
                </MenuItem>
                <MenuItem text="Item3" />
            </Menu>
        );
    }
}

ReactDOM.render(
    <App />,
    document.querySelector('my-app')
);

In this article