Skip to content

KBD

Displays keyboard keys and shortcut combinations in a styled <kbd> element.

Single key

Tailwind v4
vue
<KBD>Enter</KBD>

Key combination

Pass the keys prop with an array of key names to render a joined shortcut.

Tailwind v4
vue
<KBD :keys="['Ctrl', 'K']" />
<KBD :keys="['Cmd', 'Shift', 'P']" />
<KBD :keys="['Alt', 'F4']" />

Inline in text

KBD renders inline so it can be embedded naturally in prose.

Press + to copy, then + to paste. Or use to undo your last change.

Tailwind v4
vue
<p>
  Press <KBD>Ctrl</KBD> + <KBD>C</KBD> to copy, then <KBD>Ctrl</KBD> + <KBD>V</KBD> to paste.
  Or use <KBD :keys="['Ctrl', 'Z']" /> to undo your last change.
</p>

Common shortcuts

Search
Save
Close
Submit
Tailwind v4
vue
<KBD :keys="['Cmd', 'K']" />
<KBD :keys="['Cmd', 'S']" />
<KBD>Esc</KBD>
<KBD>Enter</KBD>

Props

PropTypeDefaultDescription
keysstring[]undefinedArray of key names to display as a shortcut combination

Slots

SlotDescription
defaultKey label for single-key usage (ignored when keys prop is provided)

Private — Jetpack Labs internal use only