Skip to content

Kbd ​

Kbd shows a key or a keyboard shortcut.

When to use ​

Use it outlined among words: in a sentence or a tooltip. Use bare in a column of shortcuts at the right end of a menu or a list. Write one shortcut as one Kbd (⌘K), not one per key.

Props ​

PropDefaultDescription
barefalseWithout the outline, for a column of shortcuts
childrenrequiredThe key or the shortcut

Contract ​

The outlined form has the height of a badge (--kata-height-badge), pad-xs at the sides and one line in --kata-color-line-strong; the text is monospace in the caption role, trimmed to its ink and centred. The bare form has no line or padding and is as tall as its ink. Kbd never shrinks in a row.

Example ​

Kbd

Released under the Apache-2.0 license.