Kbd
Atom
Keyboard shortcut indicator: a raised 24 px key cap with a mono label. keys composes a whole shortcut, one cap per key; sequence says "then" between the caps of keys pressed one after another. A shortcut reads as one accessible name ("⌘+K", "G then C"). comfortable pads the cap 3 px above and below its label and 8 px at the sides (25 px tall) for a key set beside what it does, as a reference's keyboard table lists it; omit it for the 24 px cap with 6 px sides.
Playground
Every control sets a real prop of KbdProps. The JSX below updates as you go.
Web
iOS
Android
JSX · KbdProps
Variants
4 examples from src/atoms/kbd/kbd.md, each rendered live from its own JSX.
Anatomy
1
Keycap
2
Glyph
3
Separator
Dimmed parts appear only in some states or variants.
Props
9 props on KbdProps, grouped as they are declared in source. Required props are marked *.
Accessibility and keyboard
Keyboard
Not focusable. It has no interaction of its own and takes the semantics of what it wraps.
Semantics
Roles
image
img
ARIA on web
aria-hidden
aria-label
From the docs
Keyboard shortcut indicator: a raised 24 px key cap with a mono label. keys composes a whole shortcut, one cap per key; sequence says "then" between the caps of keys pressed one after another. A shortcut reads as one accessible name ("⌘+K", "G then C"). comfortable pads the cap 3 px above and below its label and 8 px at the sides (25 px tall) for a key set beside what it does, as a reference's keyboard table lists it; omit it for the 24 px cap with 6 px sides.
Platform skins
The playground's props on each platform: same tree, native shapes, type and touch sizes.
Usage
Tokens
Read from the playground render. Values follow the scheme and the ion hue.
--fd
--fm
--ft
--ln2
--sf3
--tx