Components
Kbd
Shows a keyboard key or shortcut. Not interactive.
{/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */}
Shows a keyboard key or shortcut. Not interactive.
Import
import { Kbd, KbdGroup } from "@ir/ui";Variants
| Axis | Options | Default |
|---|---|---|
background | default · neutral · brand · opaque · on-emphasis | default |
Do and don't
Keep Kbd on radius/sm.
Don't — Round Kbd beyond radius/sm.
At 20px tall, radius/lg (10px) turns a key cap into a pill and it stops reading as a key.
Use On Emphasis only inside a filled surface, such as a primary Button.
Don't — Use On Emphasis on a light surface.
Its fill is 18% white over whatever is beneath it; on a light surface it disappears.
One key per Kbd, wrapped in KbdGroup.
Don't — Put a whole shortcut in one Kbd ("Ctrl+K").
Each key reads as its own cap, and KbdGroup renders as nested <kbd>, which is the semantic markup for a key combination.
Accessibility
- Renders <kbd>, so assistive tech can identify it as keyboard input.
- Icon-only keys (e.g. ⌘) need a text alternative nearby or an aria-label on the Kbd.
Where it is drawn
Figma — structure from figma, measurements from shadcn.