Pro
Keyboard
A keyboard that shows a shortcut where it lives: its keys are lit, and keys pressed on the real keyboard press down on this one, so people can try the shortcut and see it land. The layout follows the reader's platform.
pnpm dlx shadcn@latest add @caliper/keyboardWhen to use
Use it for
- Teaching a product's key shortcuts in onboarding, docs or a what's-new note.
- A shortcut settings page, beside the recorder.
Skip it when
- Listing many shortcuts; use the shortcut sheet.
- Inside dense app chrome; it is a teaching surface.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- Watches, never takes
- It listens to the page's key events without preventing them, so trying a shortcut still does what it does.
Styling
- Sized by its own width
- Keys are a fifteenth of the keyboard's width (container units), so it fits a phone without a breakpoint.
Installation
pnpm dlx shadcn@latest add @caliper/keyboard
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.
Usage
Import it from your copy of the source. The example behind the preview comes with the source. It is built from Keyboard and shortcutCodes.
import { Keyboard, shortcutCodes } from "@/components/ui/keyboard"
The worked example comes with Pro
The 55-line example behind the preview opens here, ready to copy.
- 576 Pro parts, blocks and page templates, all with source
- $199 once, with a year of updates. What you have stays yours
- A full refund within 14 days if it is not for you
API reference
Keyboard
component
shortcutCodes
component
No props of its own; it accepts the native props of its root element.
Accessibility
It exposes img semantics, with aria-label kept in step with state.
No custom key handling; Tab and the native activation keys do the work.
Motion
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.
Related
- KbdKeys as small raised caps: one shortcut per kbd, ⌘ on a Mac and Ctrl elsewhere, with spoken names for symbols.
- Shortcut sheetEvery keyboard shortcut in one place: while it is open, pressing a shortcut lights its row instead of running it, and a filter narrows the list.
- Shortcut recorderPress a key combination to record a keyboard shortcut, with conflict warnings.