UIIcons

Kbd

Keyboard shortcut display components for showing key combinations in UI.

⌘K
Kbd

Installation

pnpm dlx stera-ui@latest add kbd

Composition

Use the following composition to build Kbd and KbdGroup:

Kbd
KbdGroup
├── Kbd
└── Kbd

Examples

Sizes

⌘K⌘K
Kbd Sizes
SizeDescription
smCompact, for tight spaces like tooltips
mdDefault

Key Combinations

Use KbdGroup to display a sequence of keys.

CtrlB
Kbd Combo

Inside a Button

Use data-kbd="inline-end" to position a Kbd at the trailing edge of a button.

Kbd with Button

Inside an Input

⌘K
Kbd with Input

API Reference

Kbd

PropTypeDefault
size"sm" | "md""md"

Renders a <kbd> element. Accepts all standard <kbd> props.

KbdGroup

Renders a <kbd> wrapper for grouping multiple Kbd components. Accepts all standard <div> props.