Shortcut recorder
Press a key combination to record a keyboard shortcut, with conflict warnings.
Click, then press the keys.
When to use
- Settings where people choose their own shortcuts.
- You need to warn about shortcuts already in use.
When not to use
- The shortcut is fixed; show it as text.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/shortcut-recorder
Adds its 3 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
ShortcutRecorder
8 props
PropTypeDefault
label *string—
valuestring—
defaultValuestring""
onValueChange((value: string) => void)—
bindingsreadonly ShortcutBinding[][]
resetValuestring—
namestring—
classNamestring—
formatShortcut
0 props
No props of its own; it accepts the native props of its root element.
Keyboard
- Escape
- Closes or cancels, then returns focus to where it came from.
Accessibility
It exposes status semantics, with aria-pressed and aria-label kept in step with state. Changes that matter are announced through a live region.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/shortcut-recorder.mdThe index of every part is at /llms.txt.