Skip to the page
TACTILE UI

Kit part · Buttons

Key

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

Element
<button> · <a>
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

Contrast · the one action
Plain
Flat · printed text that acts
Danger · confirm in a dialog
Sizes · sm 28 · 36 · lg 46
With a lamp in the cap
A link
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
Key
Contrast
Flat—

Graphite

PartRestHoverPressedLatchedFocusDisabled
Key
Contrast
Flat—
03

API

NameKindValuesWhat it does
.tui-keyclass—A plain key: a raised cap on a 2px skirt, 36px tall.
.tui-key--primaryclass—The contrast cap: the one action on a surface that matters most.
.tui-key--flatclass—No cap at all: printed text that acts. For backing out.
.tui-key--dangerclass—Red printing on a plain cap, for destructive actions.
.tui-key--sm · --lgclass28px · 46pxSmall in tables and panel heads; large in heroes. Skirts scale with the cap: 1.5px, 3px.
.tui-key--icon · --roundclass—Keys with an icon and no words: see the icon key.
aria-pressedattribute"true" · "false"A latching key. “true” holds it down below the plate.
disabled · aria-disabledattribute—45% opacity and no travel. Use aria-disabled="true" on links.
data-tipattributetextA one-line name shown on hover and focus. Required on icon keys, with an aria-label.
--h · --skirtCSS property36px · 2pxCap height and skirt depth. The size modifiers set both.
.is-hover · .is-down · .is-focusclass—Forced states, for documentation and specimens only.
Enter · Spacekeyboard—Native button behaviour. The key presses on :active, so it drops under a finger, a mouse or a key.
04

Markup

<button class="tui-key tui-key--primary">Start recording</button>
<button class="tui-key">Save preset</button>
<button class="tui-key" aria-pressed="false">
  <span class="tui-lamp" data-on></span>Monitor
</button>
<button class="tui-key tui-key--flat">Cancel</button>

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

05

Accessibility

  • Use a real <button>, or an <a> for navigation. Both are reached with Tab and keep the 2px focus ring, 3px away.
  • Icon keys need an aria-label; the data-tip is only for sighted pointer and keyboard users.
  • A latching key announces its state through aria-pressed. The lamp in its cap is a second signal, never the only one.
  • The contrast cap holds 13:1 or better against its printing in both finishes.
06

How it’s built

Two backgrounds and a stack of box-shadows, no images. The cap is a linear gradient of --tui-face-hi under a radial highlight from above; the skirt is a hard 2px shadow in --tui-skirt, with a contact shadow and a soft one below it. Pressing moves the cap down by exactly the skirt and swaps the shadows for --tui-pressed: the plate’s edge now shades the cap’s top and sides. 70ms, one easing curve.

07

Rules

key.rules.mdIn the brain

One contrast key per surface. The label says what happens: “Erase reel”, not “Submit”.

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

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.

Selector

One mode of two to five: latching keys in a tray, one down at a time, each with a lamp that lights when chosen.

Confirm

Erase reel 3?

KeepErase

Dialog

A decision that must be made now: a native dialog with a question, one sentence of consequence, a way back and the act.

Docs
Finish
Volume