Display
Kbd
A keycap for keyboard shortcuts in prose, menus and tooltips.
<script>
import { Kbd } from "@codeatlasdev/ui";
</script>
<Kbd>Esc</Kbd>
Kbd renders a native <kbd> element. Use one per key and join combinations with a plain +. The keycap is not selectable, so double clicks on a shortcut do not select it.
Shortcuts in text
Press Ctrl + K to open the command palette, or Esc to close it.
Reference #129 · Pick in the gallery
Code
Tokens
--ca-kbd-size (a square keycap; default the keycap hugs its label), --ca-kbd-font-size and --ca-kbd-line-height: on :root, a wrapper or ThemeOptions.components.kbd.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | Snippet | – | The key label, for example Ctrl or K. |
class | string | '' | Extra classes on the `<kbd>` element. |