Steps
Numbered steps of a fixed sequence with a bar that fills as each one completes. Shows where people are in a flow and how much is left.
Usage
Use it when
- A flow with three to five fixed steps done in order: registration (details, courses, payment, review), exam setup, onboarding a school.
- People benefit from knowing how many steps remain before they commit.
Use something else when
- Sections people visit in any order: use Tabs.
- Instructions or requirements to read, not a flow to move through: use List. Use numbered rows (
.lrow--num) in a list. - Events that already happened in time: use Timeline.
- Progress of one task that runs by itself: use Progress bar.
- Lessons in a course, some done: use App shell. Use numbered child links with done marks in the shell.
Where it goes. At the top of the flow, under the page title, full width of the form column. Back and next buttons sit at the bottom of the form, not next to the steps. On phones with long labels, keep the dots and labels short (one or two words) or show "Step 2 of 4" in text instead.
Examples
- Personal detailsName and contact
- 2CoursesUp to 24 credits
- 3PaymentTuition and fees
- 4ReviewCheck and submit
<ol class="steps" aria-label="Registration progress">
<li class="step is-done">
<div class="step__head"><span class="step__dot"><span class="ic" aria-hidden="true">check</span></span><span class="step__bar"></span></div>
<span class="step__label">Personal details</span><span class="step__sub">Name and contact</span>
</li>
<li class="step is-current" aria-current="step">
<div class="step__head"><span class="step__dot">2</span><span class="step__bar"></span></div>
<span class="step__label">Courses</span><span class="step__sub">Up to 24 credits</span>
</li>
<li class="step">
<div class="step__head"><span class="step__dot">3</span></div>
<span class="step__label">Payment</span><span class="step__sub">Tuition and fees</span>
</li>
</ol>- Questions
- Schedule
- 3Publish
<ol class="steps" aria-label="Exam setup"> <li class="step is-done"><div class="step__head"><span class="step__dot"><span class="ic" aria-hidden="true">check</span></span><span class="step__bar"></span></div><span class="step__label">Questions</span></li> <li class="step is-done"><div class="step__head"><span class="step__dot"><span class="ic" aria-hidden="true">check</span></span><span class="step__bar"></span></div><span class="step__label">Schedule</span></li> <li class="step is-current" aria-current="step"><div class="step__head"><span class="step__dot">3</span></div><span class="step__label">Publish</span></li> </ol>
Anatomy
| Part | What it is |
|---|---|
ol.steps | Required. The row, with aria-label. |
li.step | Required. One step; .is-done before the current, .is-current on the current with aria-current="step". |
.step__head | Required. The dot and the bar to the next step. |
.step__dot | Required. 28 px circle with the number, or a check icon once done. |
.step__bar | The connector to the next step; fills with the accent when the step is done. Leave it out on the last step. |
.step__label | Required. The step name. |
.step__sub | Optional second line: what the step asks for. |
States
| State | How |
|---|---|
(upcoming) | Outlined dot with the number, muted label. |
.is-current | 2 px accent ring and accent number; strong label; aria-current="step". |
.is-done | Filled accent dot with a check, strong label, the bar to the next step filled. |
Motion and microinteractions
- Bar: fills left to right with
scaleX(0)toscaleX(1)over--d-considered(480 ms) on--ease-inout, because it is something already on screen moving. - Dot: background, color and ring ease over
--d-standard(240 ms). Going back reverses both, since they are transitions. - Reduced motion: both drop to 120 ms linear.
Accessibility
- An
<ol>witharia-label, so the count and order are announced. - The current step has
aria-current="step". Done steps should say so in text for screen readers if the check is the only sign (add an.sr-only"done"). - Steps are not buttons by default; if people may jump back to a done step, make its label a link or button.
- Move focus to the heading of the new step when it appears.
Do and don't
Do
- Keep it to three to five steps with one or two word labels.
- Let people go back without losing what they entered.
Don't
- Use steps for a flow with branches or optional steps.
- Put the back and next buttons inside the steps row.
- Show steps for a single-screen form.
Behavior and code
Plain HTML. None. Move .is-done, .is-current and aria-current="step" from your code; swap the number for a check icon when a step is done.
React. From lampung-design-system/react.
import { Steps } from 'lampung-design-system/react';
<Steps label="Registration progress" current={1} items={['Personal details', 'Courses', 'Payment', 'Review']} />