Skip to the page
Tactile UI

Settings row

What a settings page is made of: a label, one sentence under it and the control at the end, ruled like the list with a hairline between rows and nothing else drawn. A row with a switch or a check is one label, so pressing anywhere on it turns the control; a row with a key, a select or a value is a plain box, so a press means what the key says.

Element
<label class="tui-settings__row">
Needs
kit.css
Rules
settings-row.rules.md · 6
Finishes
Aluminium · Graphite · Chalk · Carbon · 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

Variants

A switch · the row is the label
A check
Two-step sign-inAsk for a code from your phone.
A key at the end
LanguageThe words in your dashboard.
A select at the end
Billing planTeam, billed monthly.£12 a seat
A value and a key
Delete this workspaceRemoves every project and cannot be undone.
Danger · the words say so

Notifications

A page of rows · with headings
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

PartRestHoverFocusOnDisabled
Row

Graphite

PartRestHoverFocusOnDisabled
Row

API

NameKindValuesWhat it does
.tui-settingsclassrole="group", with an aria-labelThe page or the section: rows ruled like a list. Put a .tui-settings__head heading first to print a section name.
label.tui-settings__rowelementholds .tui-settings__text and a switch or checkA row that is one control. Pressing anywhere on it turns the switch. Name the input with aria-labelledby on the title and describe it with the sentence.
div.tui-settings__rowelementholds .tui-settings__text and a key, select or valueA row that holds a control which does something when pressed. Only the control is pressable.
.tui-settings__text > .tui-settings__title + .tui-settings__descclasstwo linesThe label and the one sentence under it. Keep the sentence to what changes when the control is turned.
.tui-settings__end · .tui-settings__valueclassat the end of a rowA printed value beside its key: “£12 a seat” and Change.
.tui-settings__row--dangermodifieron the rowThe title reads in the error ink, and the key says what it destroys.
role="switch"attributeon .tui-switchMakes the checkbox a switch to a screen reader: “Email receipts, switch, on”.

Markup

<div class="tui-settings" role="group" aria-label="Notifications">
  <h3 class="tui-settings__head">Notifications</h3>

  <!-- A switch or a check: the whole row is the label -->
  <label class="tui-settings__row">
    <span class="tui-settings__text">
      <span class="tui-settings__title" id="s1-t">Email receipts</span>
      <span class="tui-settings__desc" id="s1-d">Send a receipt after every payment.</span>
    </span>
    <input class="tui-switch" type="checkbox" role="switch" aria-labelledby="s1-t" aria-describedby="s1-d" checked>
  </label>

  <!-- A key, a select or a value: a plain box -->
  <div class="tui-settings__row">
    <span class="tui-settings__text">
      <span class="tui-settings__title">Two-step sign-in</span>
      <span class="tui-settings__desc">Ask for a code from your phone.</span>
    </span>
    <button class="tui-key tui-key--sm" type="button">Set up</button>
  </div>
</div>

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

Accessibility

  • A row that holds a switch is a <label>, so the whole row is the target and the pointer, a finger and a switch-access device all reach it; on a phone the row is at least 64px tall.
  • The switch is named by the title with aria-labelledby and described by the sentence with aria-describedby, so it reads “Email receipts, switch, on, Send a receipt after every payment” and not the title and sentence run together as a name.
  • The state is the switch’s own position and its lit slot, and a screen reader hears “on” or “off”; no sentence changes with the state, so the words never contradict the control.
  • A key row is not a label on purpose: pressing the words does nothing, and the key is named by its words with the title as its description, “Set up, two-step sign-in”.
  • The focus ring goes round the whole label row when the switch has the focus, and round the key or select alone in a plain row. A disabled row dims its words and is skipped by the keyboard.

How it’s built

The list already knows how to be a rack of rows with hairlines between them, so the settings row borrows its rule exactly: a one-pixel line, inset to the words, that vanishes under the row the pointer is on. The controls are the kit’s own, a switch, a check, a key and a select, set in the row’s end with auto margin. The row is a flex box that wraps, so on a narrow screen a wide control drops under its words instead of squeezing them.

Rules

settings-row.rules.mdIn the brain

Lay out a settings page as rows that say what each setting does in a sentence, with the control where the eye ends up, and a whole row to press.

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.

Switch

On or off, applied the moment it moves. A native checkbox with a ridged thumb in a slot that lights green when on.

List

Rows in a rack: a mark, a title, a second line and a fact or a key at the end. Chosen rows sink into a recess with their check key latched; in a running order, a row lifts out of the rack on its skirt and slides past the others, from the keyboard or by its grip.

Check

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

Field

Text entry in a recess, the label printed above it, and a hint that says how to fix an error.