PrimitivesStable
Kbd
Parity report:
docs/atoms.mdA styled <kbd> (2px bottom border) for showing a key or a shortcut. size sm (default) or md. Compose several side by side for a shortcut (⌘ K).
When to use
- Documenting a keyboard shortcut in a hint, a menu ("Search ⌘K"), a help page.
- Showing an inline code snippet → a plain
<code>. A code block → the showcase's own syntax highlighting.
Examples
⌘Kabrir busca
<span style={{ display: "inline-flex", alignItems: "center", gap: 4 }}>
<Kbd>⌘</Kbd>
<Kbd>K</Kbd>
<span>abrir busca</span>
</span>EscEsc
<Kbd size="sm">Esc</Kbd>
<Kbd size="md">Esc</Kbd>Playground
K
size
<Kbd>K</Kbd>Props
| Prop | Type | default | Description |
|---|---|---|---|
size | "sm" | "md" | sm | `sm` (default) · `md`. |
Accessibility
- Uses the semantic
<kbd>element. It's presentation only — the shortcut must actually be implemented in the component it documents.