Skip to the page
TACTILE UI

Kit part · Onboarding · Steppers

Onboarding

Setting something up: stations along a groove (done ones with their lamp lit, the current one a raised cap) and a checklist of check keys with a progress slot.

Element
<ol> · <section>
Needs
kit.css + kit.mjs
Rules
onboarding.rules.md · 5
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

  1. Accountdone
  2. Hubcurrent step
  3. Doneto do
Three steps
  1. Accountdone
  2. Hubdone
  3. Meterdone
  4. Tariffdone
  5. Batterydone
Five steps · all done
  1. Accountdone
  2. Hubdone
  3. Meterdone
  4. Tariffcurrent step
  5. Batteryto do
Narrow · only the current name

Set up Hearth

All 3 done
Checklist · all done
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

PartStartUnder wayAll done
Track
  1. Hubcurrent step
  2. Meterto do
  3. Tariffto do
  4. Batteryto do
  1. Hubdone
  2. Meterdone
  3. Tariffcurrent step
  4. Batteryto do
  1. Hubdone
  2. Meterdone
  3. Tariffdone
  4. Batterydone
Checklist

Set up Hearth

0 of 4 done

Set up Hearth

2 of 4 done

Set up Hearth

All 4 done

Graphite

PartStartUnder wayAll done
Track
  1. Hubcurrent step
  2. Meterto do
  3. Tariffto do
  4. Batteryto do
  1. Hubdone
  2. Meterdone
  3. Tariffcurrent step
  4. Batteryto do
  1. Hubdone
  2. Meterdone
  3. Tariffdone
  4. Batterydone
Checklist

Set up Hearth

0 of 4 done

Set up Hearth

2 of 4 done

Set up Hearth

All 4 done
03

API

NameKindValuesWhat it does
.tui-onboarding__stepsclasson <ol>The track: stations spread evenly, a groove between each pair. Give it an aria-label.
.tui-onboarding__step · data-stateclass · attribute"done" · "current" · "upcoming"A station. Done: a green lamp in its socket. Current: a raised cap. Upcoming: an empty socket.
aria-current="step"attributeon the current <li>Announces where you are.
.tui-onboarding__stationclassaria-hiddenThe socket or cap, printed with the step’s number.
.tui-onboarding__nameclassa nounThe step’s name; a <small> inside adds a second line. Narrow tracks keep only the current one’s.
.tui-onboarding__stateclassvisually hidden“done”, “current step” or “to do”, for screen readers; setOnboardingStep rewrites it.
data-onboarding-go · aria-controlsattribute"next" · "back"On any key: steps the track it names.
.tui-onboardingclasson <section>The checklist: a head, a progress slot, the tasks.
.tui-onboarding__head · __title · __countclass—The title and “2 of 5 done”, rewritten as tasks are ticked.
.tui-progress[role=progressbar]classthe kit’sThe slot: --v and aria-valuenow follow the count.
.tui-onboarding__task · data-nextclass · attributeon <li>A task: a .tui-check, its label (b title + span detail) and a key. Only the next task shows its key.
.tui-onboarding__actionclasson a .tui-keyThe next task’s key: the contrast key of the surface.
setOnboardingStep(ol, n) · updateOnboarding(section)functionkit.mjsMove the track to step n (steps + 1 = all done); recount a checklist.
tui-onboardingeventdetail: step or done, ofFired on the track or the checklist after a change.
Space · Tabkeyboard—Tick a task with Space; the track is read, not operated: its keys step it.
04

Markup

<ol class="tui-onboarding__steps" aria-label="Setting up Hearth">
  <li class="tui-onboarding__step" data-state="done">
    <span class="tui-onboarding__station" aria-hidden="true">1</span>
    <span class="tui-onboarding__name">Account</span>
    <span class="tui-onboarding__state">done</span>
  </li>
  <li class="tui-onboarding__step" data-state="current" aria-current="step">
    <span class="tui-onboarding__station" aria-hidden="true">2</span>
    <span class="tui-onboarding__name">Hub</span>
    <span class="tui-onboarding__state">current step</span>
  </li>
  <li class="tui-onboarding__step" data-state="upcoming">…</li>
</ol>

<section class="tui-onboarding" aria-label="Set up Hearth">
  <div class="tui-onboarding__head">
    <p class="tui-onboarding__title">Set up Hearth</p>
    <span class="tui-onboarding__count">1 of 3 done</span>
  </div>
  <div class="tui-progress" role="progressbar" aria-label="Set up Hearth"
       aria-valuemin="0" aria-valuemax="100" aria-valuenow="33" style="--v:.333"></div>
  <ul class="tui-onboarding__list">
    <li class="tui-onboarding__task">
      <input type="checkbox" class="tui-check" id="t1" checked>
      <label for="t1"><b>Pair the hub</b><span>It found meter 2291.</span></label>
    </li>
    <li class="tui-onboarding__task" data-next>
      <input type="checkbox" class="tui-check" id="t2">
      <label for="t2"><b>Choose your tariff</b><span>So the battery charges cheaply.</span></label>
      <button class="tui-key tui-key--primary tui-key--sm tui-onboarding__action">Choose tariff</button>
    </li>
  </ul>
</section>
import { setOnboardingStep, updateOnboarding } from '/kit/kit.mjs';

setOnboardingStep(document.querySelector('.tui-onboarding__steps'), 3);
// Check keys inside a .tui-onboarding recount by themselves; after changing tasks:
updateOnboarding(document.querySelector('.tui-onboarding'));
document.addEventListener('tui-onboarding', (e) => save(e.detail));

Needs kit.css and kit.mjs. How to install the kit.

05

Accessibility

  • The track is an ordered list with aria-current="step" on where you are, and each station says “done”, “current step” or “to do” in words.
  • Done is a lit lamp and the word; current is a raised cap and aria-current: never the lamp alone.
  • Tasks are real checkboxes with labels; the progress slot is a progressbar whose value follows them.
  • Only the next task shows its key, so there is one contrast key on the surface and one obvious thing to do.
  • Reduced motion stops the ink running along the groove; the track shows the same.
06

How it’s built

The track is a grid of equal columns, so the stations space themselves; each station after the first draws the groove back to the one before (its ::before, the kit’s recess) and the ink along it (its ::after, scaled from 0 to 1 over 220ms when the step is reached). The done lamp and the raised cap are the kit’s lamp and key, drawn on the station. The checklist is the kit’s check keys and progress slot; onboarding.mjs recounts on every change and moves data-next.

07

Rules

onboarding.rules.mdIn the brain

Five steps at most, named as nouns; the checklist gives a key only to the next task, and a task counts as done when it is done.

5 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

Progress

Progress through a task: ink filling a groove, never a coloured bar.

Check

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

Lamp

The only colour in the kit: a lamp that is on. Green is on, amber is waiting, red is recording or failing, blue is linked, white is standing by. Always next to words.

Docs
Finish
Volume