Skip to content

Components

Keyboard shortcuts

Show keys and key combinations as key caps that match the reader's keyboard.

Use <Kbd> to show a key inline. Press CtrlCommandK to search, or Esc to close a dialog. Mod is the shortcut modifier of the reader's computer: the Command key on a Mac and Ctrl everywhere else, so one page fits both.

Kbd usage

Write the key inside <Kbd>. Join the keys of a combination with +.

html
<Kbd>Esc</Kbd>
<Kbd>Mod+K</Kbd>
<Kbd>Mod+Shift+P</Kbd>
Esc CtrlCommandK CtrlCommandShiftShiftP

A single letter is shown upper-case, and any other text is shown as written, so <Kbd>F5</Kbd> gives F5.

Key names

These names are recognized in any letter case. On a Mac, the modifier keys show their symbols, and screen readers announce every symbol by name.

WriteShowsOn a Mac
ModCtrlCommand (⌘)
Cmd, Command⌘⌘
Ctrl, ControlCtrlControl (⌃)
ShiftShiftShift (⇧)
Alt, Option, OptAltOption (⌥)
Enter, ReturnEnterReturn (↩)
BackspaceBackspaceDelete (⌫)
Esc, EscapeEscEsc
Tab, Space, DeleteTab, Space, Deletethe same
Up, Down, Left, Right↑ ↓ ← →the same

The right caps are chosen before the page first paints, so a Mac reader never sees Ctrl flash before ⌘.

Properties

childrenstringrequired

The key, or keys joined with +.