StealThis .dev

Keyboard Display

Keyboard shortcut display component with individual key caps — single keys, combinations (⌘K), and a shortcut list table.

Open in Lab
css
Targets: HTML

Code

Keyboard Display

Styled <kbd> elements for presenting keyboard shortcuts and hotkeys.

Variants

  • Single key — standalone key cap with pressed-key bevel shadow
  • Combo — multiple keys joined with + separator
  • Shortcut table — labeled list of shortcuts for cheat sheets

Usage

Wrap individual keys in <kbd> and group combinations with a <span class="kbd-combo"> container. The table variant uses standard <table> semantics with scope="row" for accessibility.