New to Telerik UI for Blazor? Start a free 30-day trial

ContextMenu Keyboard Navigation

Updated on Aug 31, 2026

This article describes how the ContextMenu keyboard navigation works and how to customize it. The article extends the general information about keyboard navigation in Telerik UI for Blazor.

The ContextMenu is a single tab stop component and it focuses the first item on open. The keyboard navigation is active while the ContextMenu is visible and focused.

Default Keys

The following table lists the default built-in keyboard shortcuts and the actions that they perform when the ContextMenu is focused. Also check the ContextMenu Keyboard Navigation demo.

Key CombinationDescription
Down ArrowMoves focus one item down.
Up ArrowMoves focus one item.
Right ArrowOpens the submenu and moves focus to the first child item.
Left ArrowCloses the submenu and moves focus to the parent item.
HomeMoves focus to the first item in the current list.
EndMoves focus to the last item in the current list.
Enter, SpaceActivates the focused item. Equivalent to a click.
EscapeCloses the ContextMenu.

Using Custom Keys

The ContextMenu supports replacing the default built-in keyboard shortcuts or adding new ones that perform the same actions.

To override the built-in ContextMenu keyboard shortcuts, you need to create a Dictionary<string, ContextMenuKeyboardCommand?>> that defines:

Set the Dictionary to the ContextMenu CustomKeyboardShortcuts parameter.

Setting custom ContextMenuKeyboardCommand keyboard shortcuts

RAZOR
<TelerikContextMenu CustomKeyboardShortcuts="@ContextMenuCustomShortcuts" />

@code {
    private Dictionary<string, ContextMenuKeyboardCommand?> ContextMenuCustomShortcuts = new()
    {
        ["w"] = ContextMenuKeyboardCommand.NavigateUp,
        ["s"] = ContextMenuKeyboardCommand.NavigateDown,
        ["d"] = ContextMenuKeyboardCommand.OpenSubmenu,
        ["a"] = ContextMenuKeyboardCommand.NavigateToParent
    };
}

Keyboard Command

The ContextMenuKeyboardCommand enum represents a user action, for example, NavigateDown, ActivateItem, OpenSubmenu, and others.

You can define multiple keyboard shortcuts that execute the same keyboard command. If a ContextMenu keyboard command has no custom key, the component uses the default key. To disable a built-in keyboard command for a specific key, use null.

Example

Example
View Source
Loading ...

See Also