Skip to content

Keyboard key

A key drawn as a key, for shortcuts in a hint or a menu — Ctrl + K, Esc, Enter.

  • .aparte-kbd
On this page
Open

.aparte-kbd draws a key: a small raised label in the code typeface, for a shortcut written in a hint, a menu or a placeholder. The search field of this site shows one.

VariableDefault
--aparte-kbd-bgvar(--aparte-surface-2)
--aparte-kbd-radiusvar(--aparte-radius-sm)
--aparte-kbd-paddingvar(--aparte-space-1) var(--aparte-space-2)
--aparte-kbd-font-sizevar(--aparte-font-size-2xs)
--aparte-kbd-min-widthvar(--aparte-space-8)
--aparte-kbd-border-bottom-widthvar(--aparte-space-1)

.aparte-kbd

  • Put the class on a <kbd> element, which says to a screen reader that this is keyboard input. Write the key’s name as text (“Ctrl”, “Esc”), not as a symbol alone.
  • Tag — a label chip.
  • Menu — where shortcuts are often shown.