Skip to content
Writing Documentation

Keyboard shortcuts

Describe keys and shortcut combinations with Markdown.

Display a key

Write :kbd[Key] in your .mdx pages. No import or plugin is required:

Press Esc to close a dialog or Enter to confirm.

md
Press :kbd[Esc] to close a dialog or :kbd[Enter] to confirm.

Write a shortcut

Write the complete combination inside one directive, separating keys with +:

Press Control plus K to open search.

md
Press :kbd[Ctrl + K] to open search.

Use spaces around the separator. RDX shows each key separately and provides a single text alternative for assistive technology, using the interface language from lang in rdx.config.ts. The English alternative for this example is "Control plus K"; in Brazilian Portuguese it is "Control mais K".

Multiple modifiers and the plus key work the same way:

Control plus Shift plus P or Control plus Plus.

md
:kbd[Ctrl + Shift + P] or :kbd[Ctrl + +].

Write individual keys separately when they describe independent actions: Enter to confirm and Esc to close.

Shortcut reference tables

ActionShortcut
Open searchControl plus K
SaveControl plus S
Close a dialogEsc
md
| Action         | Shortcut       |
| :------------- | :------------- |
| Open search    | :kbd[Ctrl + K] |
| Save           | :kbd[Ctrl + S] |
| Close a dialog | :kbd[Esc]      |

These shared shadcn/ui components render semantic <kbd> elements and follow the site's light and dark themes. Use them to describe shortcuts supported by your application. See Search for RDX's search shortcut.