Skip to the page
TACTILE UI

Kit part · Buttons · Icons

Icon key

A key with an icon and no words, square or round: transport, power, the small tools. Its aria-label names it; a tip shows the name.

Element
<button>
Needs
kit.css
Rules
key.rules.md · 6
Finishes
Aluminium · Graphite · Porcelain · Black
Volumes
Tactile · Quiet
On this page
  1. Variants
  2. Every state, at once
  3. API
  4. Markup
  5. Accessibility
  6. How it’s built
  7. Rules
  8. Related parts
01

Variants

Square
Round · power, transport
Sizes · sm 28 · 36 · lg 46
Contrast · the one action
02

Every state, at once

Both finishes, side by side. Hover, pressed and focus are forced with .is-hover, .is-down and .is-focus; checked and disabled are real.

Aluminium

PartRestHoverPressedLatchedFocusDisabled
Square
Round

Graphite

PartRestHoverPressedLatchedFocusDisabled
Square
Round
03

API

NameKindValuesWhat it does
.tui-key--iconclasswith .tui-keySquare: as wide as it is tall, no padding.
.tui-key--roundclass—A round cap, for power and transport.
aria-labelattributerequiredThe key’s name. Screen readers read this, not the icon.
data-tipattributesame wordsThe name, printed above on hover and focus.
aria-pressedattribute"true" · "false"For latching keys, like power.
svgelement16 × 16Any icon drawn in currentColor, marked aria-hidden.
--sm · --lgclass28px · 46pxSizes, as for any key.
04

Markup

<button class="tui-key tui-key--icon" aria-label="Play" data-tip="Play">
  <svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M5 3.5v9l7-4.5z"/></svg>
</button>
<button class="tui-key tui-key--icon tui-key--round" aria-label="Power" data-tip="Power" aria-pressed="false">
  <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true">…</svg>
</button>

Needs kit.css only, no script. How to install the kit.

05

Accessibility

  • The aria-label is required: an icon has no name of its own.
  • The tip shows on keyboard focus as well as hover. On touch there is no hover, so use icons people already know.
  • Put aria-hidden="true" on the SVG so the name is read once.
06

How it’s built

A key with width: var(--h) and no padding, so the cap is square at every size; round is a 999px radius on the same cap and skirt. The icon is an inline SVG in currentColor, so it prints in the key’s ink in both finishes.

07

Rules

key.rules.mdIn the brain

Icon keys need an aria-label and a data-tip.

6 rules in this file, with the foundations they rest on and the anti-patterns that break them. Full rules ship in the brain with the Pass.

08

Key

Every button, and every link that acts like one: a cap on a skirt that drops below the plate when pressed.

Tooltip

A one-line name for an icon key, printed on a small dark plate above it on hover and on keyboard focus.

Lamp

The only colour in the kit: a lamp that is on. Green is on, amber is waiting, red is recording or failing, blue is linked, white is standing by. Always next to words.

Docs
Finish
Volume