Skip to the page
Tactile UI

Kit part · Cards & panels · Checkboxes · Radio groups

Choice card

A radio or a check set as a large plate carrying a name, a sentence and a price. The plate is a big key on a skirt with a small check key in its corner; the chosen one goes down below the panel and its corner key latches. Under it is the real radio or checkbox, so a group is a native radio group and posts with the form.

Element
<label class="tui-choice-card">
Needs
kit.css
Rules
choice-card.rules.md · 6
Finishes
Aluminium · Graphite · Oak · Walnut · Porcelain · Black · Daylight · Night · Paper · Phosphor · E-paper · AMOLED
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

Seats open in 11 days. Want one email that morning?

Variants

Plan
One of three · radios
Add-ons
Any number · checks
Billing
A column · --stack
Delivery
Without a price
Plan
Disabled

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

PartUpHoverPressingChosenFocusDisabled
Plate

Graphite

PartUpHoverPressingChosenFocusDisabled
Plate

API

NameKindValuesWhat it does
<fieldset class="tui-choice-cards">elementwith a legendThe group and its name, around a .tui-choice-cards__set grid that fits as many plates as the width holds. Add --stack to the fieldset for a single column.
label.tui-choice-cardelementholds the input and its wordsOne plate. The label is the plate, so a press anywhere on it is a press on the input.
input.tui-choice-card__inputelementradio or checkboxThe real control, laid over the whole plate and invisible. Give radios one name; set checked and disabled on it as on any input.
.tui-choice-card__name · __desc · __priceclassin the labelThe name, the sentence and the price. Put the unit in a small inside the price: “£12 a seat, monthly”.
.tui-choice-card__markclassaria-hiddenThe small check key in the corner: round for a radio, square with a tick for a check. It is drawn from the input’s state.
aria-disabledattributeon a disabled plate’s labelOptional beside the input’s disabled; it lets the reader’s tools treat the plate as dimmed on purpose.
← → ↑ ↓ · Spacekeyon the inputThe browser’s own: arrows move and choose in a radio group, Space chooses a card or turns a check.

Markup

<fieldset class="tui-choice-cards">
  <legend class="tui-label">Plan</legend>
  <div class="tui-choice-cards__set">
    <label class="tui-choice-card">
      <input class="tui-choice-card__input" type="radio" name="plan" value="team" checked>
      <span class="tui-choice-card__name">Team</span>
      <span class="tui-choice-card__mark" aria-hidden="true"></span>
      <span class="tui-choice-card__desc">Shared projects for up to ten people.</span>
      <span class="tui-choice-card__price">£12 <small>a seat, monthly</small></span>
    </label>
    <label class="tui-choice-card"> … </label>
  </div>
</fieldset>

<!-- Any number: checkboxes. A column: tui-choice-cards--stack -->
<input class="tui-choice-card__input" type="checkbox" name="addon" value="support">

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

Accessibility

  • Each card is a native radio or checkbox inside its label, so the name read out is the label’s whole text, “Team, Shared projects for up to ten people, £12 a seat, monthly, radio button, 2 of 3”, with the group’s legend before it.
  • The chosen card is told three ways that are not colour: it sits lower, its corner key is latched with a dot or a tick, and the browser says “checked”. Nothing here lights a hue.
  • The focus ring goes round the whole plate when its input has the focus, 2px, offset so the skirt does not hide it, and it is as visible on the pressed card as on the others.
  • A group of radios gets the browser’s own arrow keys and one tab stop; a set of checks has a tab stop to each, as any checkboxes do.
  • On a phone each plate is at least 64px tall and spans the width of its column, the grid never scrolls sideways and the press needs no hover.

How it’s built

It is the kit’s key drawn large: the same cap, the same skirt (three pixels, as a large key has) and the same pressed shadow, so the plate goes down below the panel exactly as a key does and follows every finish and both volumes. The corner key is the check key drawn small, driven by the input’s own state with ~ instead of a script. The input is stretched over the plate with zero opacity, which is why a press, a label, a focus and the arrow keys all stay the browser’s.

Rules

choice-card.rules.mdIn the brain

Let people pick a plan, a size or an add-on by pressing a whole plate that says what it is and what it costs, with no script.

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.

Radio

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

Check

An option in a form: a small square key that presses below the plate when chosen, with a tick printed on it.

Key

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

Segmented control

A row of keys in a tray with one pressed down: pick a view, a range or a mode and it applies at once. It is the kit’s selector without the lamps, with sizes, a full-width row and icon segments.