Shortcut key
Shows a key on the keyboard, for hints about keyboard shortcuts.
Sizes
Large is the default. Small fits next to body text.
esc
esc
<.shortcut_key>esc</.shortcut_key>
<.shortcut_key size="small">esc</.shortcut_key>
Combinations
One key per element, placed side by side.
⌘
K
<.shortcut_key>⌘</.shortcut_key>
<.shortcut_key>K</.shortcut_key>
With an action
A small key next to the action it triggers.
↵
Open
esc
Close
<span>
<.shortcut_key size="small">↵</.shortcut_key>
Open
</span>
<span>
<.shortcut_key size="small">esc</.shortcut_key>
Close
</span>
Guidelines
- Put one key in each shortcut key and place them side by side for combinations.
-
Use
smallnext to body text, such as in a modal footer.largeis the default and suits standalone hints. -
Each key renders a
<kbd>element around its content. Use symbols such as ⌘ and ↵, or short names such as esc. - Pair the keys with the action they trigger, such as Close or Search, instead of showing them alone.
API reference
<.shortcut_key>
| Attribute | Type | Default | Description |
|---|---|---|---|
|
size
|
string
|
"large"
|
Size of the shortcut key
"small""large"
|
| Slot | Description |
|---|---|
|
inner_block
|
|