Skip to content
caliper ui pro docs

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.

Pro
`1234567890-=⌫
tabQWERTYUIOP[]\
capsASDFGHJKL;'enter
shiftZXCVBNM,./shift
ctrlwinaltaltctrl←↑↓→

Press search on your keyboard.

When to use

  • Teaching a product's key shortcuts in onboarding, docs or a what's-new note.
  • A shortcut settings page, beside the recorder.

When not to use

  • Listing many shortcuts; use the shortcut sheet.
  • Inside dense app chrome; it is a teaching surface.

Installation

terminal
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.

API reference

Keyboard

6 props
PropTypeDefaultDescription
shortcutstring—The combination to light, e.g. "mod+k" or "shift+enter".
labelstring—
listenbooleantruePress keys on screen as they are pressed on the real keyboard.
platformKbdPlatform—
onPress((code: string, event: KeyboardEvent) => void)—Every key code pressed while listening, for a demo that reacts to the shortcut.
classNamestring—

shortcutCodes

0 props

No props of its own; it accepts the native props of its root element.

Keyboard

  • No custom key handling; Tab and the native activation keys do the work.

Accessibility

It exposes img semantics, with aria-label kept in step with state.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/keyboard.md

The index of every part is at /llms.txt.

More in Actions