Radio
One choice from a short list in a form: small round keys in a fieldset, the chosen one pressed with a printed dot.
Kit part · Radio groups · Tabs
One mode of two to five: latching keys in a tray, one down at a time, each with a lamp that lights when chosen.
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
| Part | First chosen | Second chosen | Focus on a key |
|---|---|---|---|
| Lamps | |||
| Plain |
Graphite
| Part | First chosen | Second chosen | Focus on a key |
|---|---|---|---|
| Lamps | |||
| Plain |
| Name | Kind | Values | What it does |
|---|---|---|---|
| .tui-seg | class | — | The tray. Each child label holds a hidden radio and its visible key. |
| .tui-seg--plain | class | — | No lamps: for view filters, ranges and finishes. |
| role="radiogroup" · aria-label | attribute | required | Names the group, since there is no legend. |
| input[type=radio] + span | markup | — | The radio is visually hidden but real; the span is the key. |
| checked | attribute | — | The chosen key is latched below the plate and its amber lamp lights. |
| display: grid | CSS | — | Stack the keys vertically when labels are long. |
| change | event | — | Native, on the radio that became checked. |
| Arrows | keyboard | — | Native radio behaviour: arrows move the choice and the focus together. |
<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.
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.
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.
One choice from a short list in a form: small round keys in a fieldset, the chosen one pressed with a printed dot.
Views of the same thing, switched in place: keys in a tray, the chosen view a raised cap.
Every button, and every link that acts like one: a cap on a skirt that drops below the plate when pressed.