Kbd
Display a key or keyboard shortcut.
Installation
pnpm dlx shadcn@4.18.0 add @siteplane/kbdComplete the one-time setup first. Registry JSON lists source files and dependencies.
For this page’s examples, also install:
pnpm dlx shadcn@4.18.0 add @siteplane/button @siteplane/input-groupUsage
import { Kbd } from "@/siteplane/components/kbd";
<Kbd>Esc</Kbd>;Composition
KbdGroup
├── Kbd
└── KbdIn text
Use KbdGroup for keys that are pressed together, for example in a hint sentence. The application must implement any shortcut it displays.
Press ⌘K to open the command menu.
Input group
Show the shortcut that focuses a field in an input group addon.
Button
Add a shortcut hint after a button label; it becomes part of the button's accessible name.
API reference
Kbd and KbdGroup both render native kbd elements and accept their attributes, refs, children and string className. Kbd supplies the small muted key surface; KbdGroup supplies horizontal spacing without a key surface. There are no owned props or behavior defaults beyond this presentation. See HTML kbd.
Usage notes
Choose shortcut labels for the user’s platform. Do not make a displayed shortcut the only way to discover or invoke an action.