Skip to content

Components

Keyboard Shortcut

Renders a keyboard shortcut in its own key cap.

Usage

Basic

Cmd K
HTML
<bs:bsui-stack direction="row" gap="2" justify="center">
  <bs:bsui-kbd label="Cmd" />
  <bs:bsui-kbd label="K" />
</bs:bsui-stack>

In a sentence

Keys keep their box while the prose around them stays muted.

Press Ctrl Shift P to open the command palette.
HTML
<bs:bsui-stack direction="row" gap="1" align="center" justify="center">
  <bs:bsui-text content="Press" variant="muted" tag="span" />
  <bs:bsui-kbd label="Ctrl" />
  <bs:bsui-kbd label="Shift" />
  <bs:bsui-kbd label="P" />
  <bs:bsui-text content="to open the command palette." variant="muted" tag="span" />
</bs:bsui-stack>

Named keys

A long key name grows sideways and keeps the same height.

Esc Tab Enter Space
HTML
<bs:bsui-stack direction="row" gap="2" justify="center">
  <bs:bsui-kbd label="Esc" />
  <bs:bsui-kbd label="Tab" />
  <bs:bsui-kbd label="Enter" />
  <bs:bsui-kbd label="Space" />
</bs:bsui-stack>

Attributes

AttributeTypeDefault
label richtext —