Svelte KBD - Bitblue

Indicate keyboard shortcuts and key combinations with the KBD component

Use Kbd to document shortcuts in help text, command palettes, and docs.

Setup

<script lang="ts">
	import { Kbd } from '.';
</script>

Default

Press Ctrl + C to copy
<script lang="ts">
	import { Kbd } from '.';
</script>

<span>Press</span>
<Kbd>Ctrl</Kbd>
<span>+</span>
<Kbd>C</Kbd>
<span>to copy</span>

Common shortcuts

Shift Ctrl Alt ⌘ Enter Esc Tab ↑ ↓
<Kbd>Shift</Kbd>
<Kbd>Ctrl</Kbd>
<Kbd>Alt</Kbd>
<Kbd>⌘</Kbd>
<Kbd>Enter</Kbd>
<Kbd>Esc</Kbd>

Chord sequences

⌘ + Shift + P Command palette
<Kbd>⌘</Kbd>
<span>+</span>
<Kbd>Shift</Kbd>
<span>+</span>
<Kbd>P</Kbd>

Custom class

⌘K
<Kbd class="border-primary-300 bg-primary-50 text-primary-800">⌘K</Kbd>

Props

PropTypeDefaultDescription
childrenSnippet—Key label content (required)
classClassValue—Extra classes on the <kbd>
...restHTMLAttributes<HTMLElement>—Native attributes

Theme base: rounded-lg border border-gray-200 bg-gray-100 px-2 py-1.5 text-xs font-semibold text-gray-800 (with dark variants).


© 2026 Bitblue is a registered trademark. All Rights Reserved.