Skip to content

Kbd

Keyboard key chip.

kbd() renders a keyboard key chip styled with --cpd-secondary and a subtle inner shadow.

Keys
K Ctrl Shift
kbd('');
kbd('K');
kbd('Ctrl');
Chord
Ctrl + Shift + P
[kbd('Ctrl'), ' + ', kbd('Shift'), ' + ', kbd('P')].join('');
OptionTypeDescription
textstringKey label (first argument).
  • Renders as <kbd class="cpd-kbd">; combination separators are plain text joined with string concatenation.
  • Use the --cpd-font-mono family for consistent key glyphs.