Skip to the page
TACTILE UI

Kit part · Radio groups · Tabs

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.

Element
radio group
Needs
kit.css
Rules
selector.rules.md · 4
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

With lamps · machine modes
Plain · filters and finishes
Stacked · long labels
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

PartFirst chosenSecond chosenFocus on a key
Lamps
Plain

Graphite

PartFirst chosenSecond chosenFocus on a key
Lamps
Plain
03

API

NameKindValuesWhat it does
.tui-segclass—The tray. Each child label holds a hidden radio and its visible key.
.tui-seg--plainclass—No lamps: for view filters, ranges and finishes.
role="radiogroup" · aria-labelattributerequiredNames the group, since there is no legend.
input[type=radio] + spanmarkup—The radio is visually hidden but real; the span is the key.
checkedattribute—The chosen key is latched below the plate and its amber lamp lights.
display: gridCSS—Stack the keys vertically when labels are long.
changeevent—Native, on the radio that became checked.
Arrowskeyboard—Native radio behaviour: arrows move the choice and the focus together.
04

Markup

<div class="tui-seg" role="radiogroup" aria-label="Band">
  <label><input type="radio" name="band" value="fm" checked><span>FM</span></label>
  <label><input type="radio" name="band" value="am"><span>AM</span></label>
  <label><input type="radio" name="band" value="lw"><span>LW</span></label>
  <label><input type="radio" name="band" value="phono"><span>Phono</span></label>
</div>

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

05

Accessibility

  • Real radios underneath: one Tab stop for the group, arrow keys to move, announced as “Band, FM, radio, 1 of 4”.
  • The focus ring draws on the visible key, 2px out.
  • Chosen is the key’s depth and its printing weight as well as the amber lamp.
06

How it’s built

The tray is the kit’s recess. Each radio is kept in the DOM with opacity: 0; the adjacent span is the key, with a 5px lamp drawn as its ::before. input:checked + span moves the key down 1.5px, gives it the pressed shadow and lights the lamp in --tui-amber. No script.

07

Rules

selector.rules.mdIn the brain

Lamps for the modes of a machine; the plain version for view filters and finishes.

4 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

Radio

One choice from a short list in a form: small round keys in a fieldset, the chosen one pressed with a printed dot.

Tabs

Views of the same thing, switched in place: keys in a tray, the chosen view a raised cap.

Key

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

Docs
Finish
Volume