# Wizard Keyboard Navigation

This article describes how the Wizard keyboard navigation [works](https://www.telerik.com/blazor-ui/documentation/components/wizard/keyboard-navigation#default-keys) and how to [customize](https://www.telerik.com/blazor-ui/documentation/components/wizard/keyboard-navigation#using-custom-keys) it. The article extends the general information about [keyboard navigation in Telerik UI for Blazor](https://www.telerik.com/blazor-ui/documentation/accessibility/overview#keyboard-navigation).

The Wizard is a single tab stop component and its keyboard navigation is active while the component's Stepper is focused.

## Default Keys

The following sections list the default built-in keyboard shortcuts and the actions that they perform when the Wizard Stepper is focused. Also check the [Wizard Keyboard Navigation demo](https://demos.telerik.com/blazor-ui/wizard/keyboard-navigation).

<style>
    .article table {
        table-layout: auto;
        word-break: normal;
    }
</style>

| Key Combination           | Description                 |
| ------------------------- | --------------------------- |
| `ArrowRight`, `ArrowDown` | Moves to the next step.     |
| `ArrowLeft`, `ArrowUp`    | Moves to the previous step. |
| `Home`                    | Moves to the first step.    |
| `End`                     | Moves to the last step.     |

## Using Custom Keys

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

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

* Key names as `string` values. Use the same key names as in the [`KeyboardEventArgs.Key`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.web.keyboardeventargs.key) property, for example, `"B"`, `"Enter"`, or `"ArrowDown"`.
* Keyboard commands to execute as [`WizardKeyboardCommand`](https://www.telerik.com/blazor-ui/documentation/components/wizard/keyboard-navigation#keyboard-command) values.

Set the `Dictionary` to the Wizard `CustomKeyboardShortcuts` parameter.

> caption Setting custom WizardKeyboardCommand keyboard shortcuts

```RAZOR.skip-repl
<TelerikWizard CustomKeyboardShortcuts="@WizardCustomKeyboardShortcuts" />

@code {
    private Dictionary<string, WizardKeyboardCommand?> WizardCustomKeyboardShortcuts => new()
    {
        { "Enter", WizardKeyboardCommand.NavigateToNextStep }
    };
}
```

### Keyboard Command

The [`WizardKeyboardCommand`](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.wizardkeyboardcommand) enum represents a user action, for example, `NavigateToNextStep`.

You can define multiple keyboard shortcuts that execute the same keyboard command. If a Wizard 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

The following sample shows how to:

* Disable `ArrowUp` and `ArrowDown` and only use `ArrowRight` and `ArrowLeft` for nevigating to the next and previous step.
* Disable `Home` and `End`, so that there is no way to jump to the first or last step.

<demo metaUrl="client/wizard/keyboard-navigation/example-1/" height="450"></demo>

## See Also

* [Online Demo: Wizard Keyboard Navigation](https://demos.telerik.com/blazor-ui/wizard/keyboard-navigation)
* [Keyboard navigation in Telerik UI for Blazor](https://www.telerik.com/blazor-ui/documentation/accessibility/overview#keyboard-navigation)
* [Telerik UI for Blazor Accessibility Overview](https://www.telerik.com/blazor-ui/documentation/accessibility/overview)
