Spelte

Open Github

Keyboard Shortcuts

Display keyboard shortcuts with proper key symbols.

K

Installation

pnpm dlx shadcn-svelte@latest add https://spelte.dev/r/kbd.json

Examples

Key Symbols

K SHIFTA ESC

Props

PropTypeDefaultDescription
keys(string | { display: string; key: string })[]Array of key names to display. Supports: command/cmd, control/ctrl, alt/option, shift, enter, space, arrowleft/left, arrowdown/down, arrowup/up, arrowright/right, or any letter/number
activebooleanForce the pressed visual state
listenToKeyboardbooleanfalseShow pressed state when keys are pressed
classstringAdditional CSS classes