Keyboard Shortcut

A component that displays keyboard shortcuts and can optionally highlight when the keys are pressed. It's useful for showing keyboard shortcuts in your application.

ShiftS

Press both keys.

Props

NameDefaultType
keysstring
The key or combination of keys to display (e.g., Escape or Ctrl+A)
labelstring
Custom label to display instead of the automatically formatted keys
highlightfalseboolean
Whether to highlight the shortcut when the keys are pressed

Slots

NameAcceptsDescription
defaultanyContent to be displayed instead of the label or selected keys. This is useful when you want to display an icon instead of just text.

Events

NamePayloadDescription
trigger-Emitted when the key or combination of keys is pressed

KbdGroup

You can wrap individual <Kbd /> components in a <KbdGroup /> in case you want to visually distinguish each key inside a keyboard shortcut.

Slots

NameAcceptsDescription
default<Kbd>Individual keys inside a shortcut. Any other component will error.

Events

NamePayloadDescription
trigger-Emitted once all the <Kbd /> components are triggered