GitHub
Open Github

Keyboard Shortcuts

Display keyboard shortcuts with proper key symbols.

Installation

pnpm dlx shadcn@latest add @spell/kbd

Examples

Key Symbols

Custom Display with Keyboard Listener

Usage

import { Kbd } from "@/components/kbd";
<Kbd keys={["cmd", "K"]} />
<Kbd keys={["ctrl", "shift", "P"]} />
<Kbd keys={["alt", "tab"]} />

Props

PropTypeDefault
keys
(string | { display, key })[]
-
className
string
-
active
boolean
-
listenToKeyboard
boolean
-