Kbd

Data Display

Keyboard shortcut visualization with platform detection and key combination formatting

Kbd

Display keyboard keys, shortcuts and combinations with support for variants, sizes, custom separators and a rich composition API.

Basic keys

Use Kbd to render individual keys like letters, arrows or special keys.

AEnterEscapeSpaceTabDelete←→↑↓

Modifier symbols

Render common modifier symbols like Command, Shift, Option and Control using unicode glyphs.

Command

⌘

Shift

⇧

Option

⌥

Control

⌃

Enter

⏎

Delete

⌫

Escape

⎋

Tab

⇥

Key combinations

Group multiple keys together with KbdGroup to describe keyboard shortcuts.

Command palette
⌘+K
Save file
⌘+S
Copy
⌘+C
Multi-modifier
⌘+⇧+⌥+P

Variants & colors

Control appearance using variant and semantic color variants on KbdGroup.

Default

⌘+K

Bordered

⌘+K

Solid

⌘+K

Primary

⌘+K

Success

⌘+↵

Warning

⌃+C

Error

⌘+⌥+⎋

Info

?

Sizes

Adjust the overall size of key groups using the size prop.

Small

⌘+K

Medium

⌘+K

Large

⌘+K

Custom separators

Add visual separators between keys using the separator prop on KbdGroup.

Plus separator
Ctrl+Alt+Delete
“then” separator
GthenG
Slash
?
Arrow
File→Save

Composition API

Use KbdKey and KbdDescription inside Kbd for rich key descriptions, ideal for legend UIs or onboarding.

⌘Command⇧Shift⌥Option⌃Control

States & real-world shortcuts

Highlight normal, pressed and disabled states, and combine them for real-world shortcuts in your UI.

Normal

⌘

Pressed

⌘

Disabled

⌘

Quick command

Open command palette

⌘+K

Vim navigation

Go to first line

GthenG

Force quit

macOS force quit dialog

⌘+⌥+⎋

Usage Guidelines

When to Use

  • Keyboard shortcuts
  • Hotkey documentation
  • Command references

Accessibility

  • Proper key semantics
  • Platform-specific modifiers

Performance

  • Static rendering
  • No JavaScript

Common Mistakes

  • Wrong platform modifier
  • Not using for actual shortcuts

Frequently Asked Questions

View on GitHub

See the full source code on GitHub