Usage
import { Kbd, KBD_SIZE_CLASSES, KbdGroup, KbdGroupProps, KbdProps, kbdVariants } from "@desk/ui/components/kbd";Best practices
Wrap multi-key chords in
KbdGroupand setsizeon the group — children inherit it via context, so you size the combo once.It renders a semantic
<kbd>; reserve it for keyboard keys/shortcuts, not as a generic small-label chip (that'sBadge).
Props
Kbd
| Prop | Type | Default | Description |
|---|---|---|---|
| tone | "neutral" | "brand" | "danger" | null | undefined | ||
| emphasis | "outline" | "solid" | "ghost" | "soft" | null | undefined | ||
| size | ResponsiveSize | "sm" | Kbd size — a single token or a per-breakpoint object like
|
KbdGroup
| Prop | Type | Default | Description |
|---|---|---|---|
| size | ResponsiveSize | Size to apply to all child Kbd components — a single token or a
per-breakpoint object like |
Also exports
- const
KBD_SIZE_CLASSES - type
KbdGroupProps - type
KbdProps - const
kbdVariants
Composition
Used by