Skip to content
Design System
GitHub

A keyboard key in shortcuts and instructions; KbdGroup for chords.

EscEnterSpace⌘⇧Tab

Kbd keys

Install
npx shadcn add @syncrobotic/kbd

Also installs: @syncrobotic/cn

Overview

A key cap for shortcuts and keyboard instructions, alone or grouped into a chord.

When to use

  • Shortcut hints in menus, tooltips and search fields.
  • A keyboard reference list.
  • Instructions like Hold Space to stop all.

Use something else

  • A code value or ID: a <code> span in font-mono.

More examples

States and real uses. Each example is also a Storybook story and a visual regression test.

Open the command palette with ⌘K or CtrlK

Kbd chord

Forward
LeftBackRight

Kbd arrows

⌘K

Kbd in input

Point at the button or tab to it.

Kbd in tooltip

Stop this robot
Space
Stop all robots
HoldSpace
Search
⌘K
Next alarm
J
Acknowledge
A

Kbd shortcut list

123

Kbd pressed

1Yes2No3Skip

Press 1, 2 or 3.

Kbd pressed live

Usage rules

  • One key per Kbd; a chord is a KbdGroup without plus signs.
  • Use the platform's symbols: ⌘ on Mac, Ctrl elsewhere.
  • pressed shows the key going down (it sinks and its edge darkens) while its shortcut runs; useHotkeys returns which key that is.

Changelog

  • 0.16.02026-11-19pressed shows a key going down while its shortcut runs (it sinks and its edge thickens to the text colour, --motion-fast); useHotkeys returns which key that is.
  • 0.10.02026-11-18Radius 4 (radius-2xs), so a key inside a tooltip or an input keeps clear of the corner around it.
  • 0.9.02026-11-17New.

How to upgrade