Keyboard Input

Keys and shortcuts rendered as keys, not prose.

v1.0.0·Updated Jul 8, 2026 · 10:45
Live Demo — Fully Interactive
Single keys, rendered as keys
A?
Arrow keys
Configuration
Size
Combo
+K
<Kbd keys={["⌘", "K"]} />
Behavior — The Engineering Contract
PropTypeNotes
keysstring[]One or more keys; joined into a chord
sizeS · M · L18 / 22 / 30px cap height
elementkbdSemantic <kbd> for assistive tech
platformauto⌘ on macOS, Ctrl elsewhere

Kbd renders the keys to press. It is display only — pair it with a Menu item, a Tooltip, or docs copy, never as a control.

Anatomy
+K
1Key capMono glyph on a bevelled cap with a 2px base.
2JoinA muted plus between keys of a chord.
Do's and Don'ts
✓ Do
+K

Use modifier symbols and a real <kbd> element.

✕ Don't
Cmd + K

Don't spell out modifiers in plain text. Render the keys.

✓ Do
Save +S

Pair a shortcut with the action it triggers.

✕ Don't
++++F+5

Don't document impossible chords. Keep them memorable.

In context: Examples
A · Menu row
Copy +C

Trailing shortcuts in a Menu or Command palette.

B · Tooltip
Search ⌘K

Hinting a shortcut inside a tooltip.

C · Docs
Press G+P to jump to Projects.

Inline in documentation and onboarding.

Measurements & Tokens
TokenValueRole
--kbd-h18 / 22 / 30pxCap height S / M / L
--kbd-bg#1A1B20Cap fill
--kbd-border#2E2F36Edge, 2px on the bottom
--kbd-textmono · #CFD3DAGlyph colour
--kbd-plus#565A62Chord join
--kbd-radius6pxCap corner
Code
<kbd class="o-kbd">⌘</kbd>

<span class="o-kbd-combo">
  <kbd class="o-kbd">⌘</kbd><span class="o-kbd__plus">+</span><kbd class="o-kbd">K</kbd>
</span>