Kbd

Displays a keyboard key or shortcut

Category: display · WCAG 2.2-AA · keyboard, shortcut, hotkey

Sizes

Props

PropTypeDefaultDescription
size'sm' | 'md'mdVisual size of the component (e.g. 'sm', 'md', 'lg').

Design tokens

When to use

When not to use

How to build an accessible Kbd in React →

Examples

Single key

<Kbd>⌘</Kbd>

Shortcut

Compose multiple keys to show a shortcut

<span><Kbd>⌘</Kbd> + <Kbd>K</Kbd></span>

Small

<Kbd size="sm">Esc</Kbd>

Related components

← Back to docs