Keyboard Shortcut

Display keyboard shortcuts with proper key symbols.

runed
⌥ ENTER ␣ ⌃J HOLD ↑

Installation

pnpm dlx shadcn-svelte@latest add https://sv-animations.vercel.app/s/kbd.json

Usage

<script lang="ts">	import { Kbd } from "#lib/components/spell/keyboard-shortcut/index.js";</script>
<Kbd keys={["command", "k"]} />

Examples

Live Keyboard Listening

Enable keyboard listening to highlight the keycap automatically when the matching shortcut is currently pressed.

⌘ ⌃ ⌥ ↑ ↓ ← →

Custom Display with Keyboard Listener

Press M key to activate

HOLD

Props

NameTypeDefaultDescription
keys(string | { display: string; key: string })[][]
activebooleanfalse
listenToKeyboardbooleanfalse
classClassValue''