Keyboard shortcut
Press Esc to close Open search with ⌘ K Save: Ctrl S
A keyboard-shortcut hint, rendered with the semantic <kbd> element.
Import
Section titled “Import”<script> import Kbd from "@invisible-ui/svelte/Kbd.svelte";</script><script setup> import { Kbd } from "@invisible-ui/vue";</script>import { Kbd } from "@invisible-ui/react";<script type="module"> import "@invisible-ui/elements/define";</script>
<ds-kbd></ds-kbd>In Elements:
<ds-kbd>Esc</ds-kbd><ds-kbd keys="⌘ K"></ds-kbd>| Prop | Type | Default | Description |
|---|---|---|---|
keys | string[] | undefined | undefined | A chord of keys, each rendered as its own keycap and joined by separator. |
separator | string | "+" | Separator shown between chord keys. Defaults to "+". |
| Prop | Type | Default | Description |
|---|---|---|---|
keys | string[] | undefined | A chord of keys, each rendered as its own keycap and joined by separator. |
separator | string | "+" | Separator shown between chord keys. Defaults to "+". |
Slots: default.
| Prop | Type | Default | Description |
|---|---|---|---|
keys | string[] | — | A chord: each key renders as its own keycap, joined by separator. |
separator | string | "+" | Separator shown between chord keys. Defaults to "+". |
children | ReactNode | — | A single key, used when keys is empty. |
| Attribute | Reactive | Description |
|---|---|---|
keys | yes | space-separated |
separator | yes |
Reactive attributes re-render the element when they change after the first render.
Properties: keys (a string array; use it for a key name that contains a space).
Pass a single key as the default slot, or a chord via the keys array.
Example
Section titled “Example”<Kbd>Esc</Kbd><Kbd keys={["⌘", "K"]} />In React:
<Kbd>Esc</Kbd><Kbd keys={["⌘", "K"]} />Themeable via --ds-kbd-*.