Skip to content

Keyboard shortcut

Press Esc to close Open search with ⌘ K Save: Ctrl S

A keyboard-shortcut hint, rendered with the semantic <kbd> element.

<script>
import Kbd from "@invisible-ui/svelte/Kbd.svelte";
</script>

In Elements:

<ds-kbd>Esc</ds-kbd>
<ds-kbd keys="⌘ K"></ds-kbd>
PropTypeDefaultDescription
keysstring[] | undefinedundefinedA chord of keys, each rendered as its own keycap and joined by separator.
separatorstring"+"Separator shown between chord keys. Defaults to "+".

Pass a single key as the default slot, or a chord via the keys array.

<Kbd>Esc</Kbd>
<Kbd keys={["⌘", "K"]} />

In React:

<Kbd>Esc</Kbd>
<Kbd keys={["⌘", "K"]} />

Themeable via --ds-kbd-*.