Components / feedback
Stages
Where a person or a job stands in a sequence of named stages.
Summary
Where a person or a job stands in a sequence of named stages.
| APG pattern | none |
| Built on | native elements |
| Status | self-tested |
| Since | 0.16.0 |
<Stages
label="Reading your statements"
current={2}
busy
stages={[
{ label: 'Reading files', note: '60 files, 10 accounts' },
{ label: 'Matching transfers', note: '212 pairs matched' },
{ label: 'Sorting into categories' },
{ label: 'Finding patterns' },
]}
/>
<Stages kind="rail" label="First run" current={1} stages={steps} />
Anatomy
A <div data-se="stages">, a group named by its label. Inside it, list holds one stage for each stage: a mark, the label, and a note under the name once the stage is complete. Only the current stage is marked, with aria-current="step". A rail adds position, the place in words.
| Part | Element | Required |
|---|---|---|
label | <span> | yes |
list | <ol> | yes |
mark | <span> | yes |
note | <span> | no |
position | <p> | yes |
sr | <span> | no |
stage | <li> | yes |
Properties
| Property | Values | Default | What it does |
|---|---|---|---|
stages | StagesStage[] | required | The stages, in order. |
current | number | required | Which stage this is, counted from 0. Every stage before it is complete. Equal to the number of stages, all of them are. |
busy | boolean | none | The current stage is a job that is running, not a screen the reader is on. Its mark turns. |
kind | list · rail | list | list draws every stage on its own row with its name. rail draws one segment for each stage on a single line, with the place written beside it. |
label | string | required | The name of the sequence: First run, Reading your statements. Not drawn. |
positionText | string | none | The place in words, in the reader's language. Left out, it is 2 of 9 · Statements. Drawn beside a rail; spoken, and not drawn, for a list. |
completeText | string | complete | The word read after a complete stage's name. |
busyText | string | in progress | The words read after the current stage's name while busy is set. |
States
| State | Expressed as | |
|---|---|---|
| Busy | aria-busy | |
| Current | aria-current |
Complete and not reached are read from position, not written. Every stage before the current one is complete; every stage after it is at rest. Nothing on a stage says so, which means the look cannot disagree with aria-current. When current is the number of stages there is no current stage, and the root carries data-complete to say every stage is complete.
Behavior
Exactly one stage is current. Stages before it are complete and stages after it are at rest; none is skipped.
It reports and does not navigate. A stage is not pressed to go to it.
The place is always in words. A rail writes it beside the segments. A list holds the same words where only a screen reader finds them. Either way they sit in a status region, so a change of stage is spoken once without taking focus.
A note appears when its stage is complete, under the stage's name. It says what the stage produced.
Accessibility
A complete stage says so in words. No ARIA state means "finished", so the word follows the name, where a screen reader reads it and a sighted reader sees the check. completeText and busyText are the words, for an app in another language.
In a rail the segments are hidden and the place is read. Nine thin segments cannot be counted at a glance, and cannot be read at all by a screen reader.
Keyboard
None of its own. It is not focusable and takes no keys.
Roles, states and properties
| Attribute | Set by |
|---|---|
aria-busy | set at render |
aria-current | set at render |
aria-hidden | set at render, always true |
aria-label | set at render |
role | always group, always list, always status |
Focus
Never takes focus. It reports a place and offers no action.
Screen reader
Not recorded as verified. Stage 4 of the readiness ladder — driving each component with VoiceOver and NVDA — is unstarted across the package, and no component should claim otherwise until docs/journal/ records the session that did it.
Contrast and target size
npm run check:contrast audits every color pair this component uses across all four skins, light and dark, and fails the build on a shortfall. Two waivers are on the record in docs/audit/DEFERRED.md.
It sets no target size of its own; anything interactive inside it brings its own.
Tested
test/apg/stages.test.jsxtest/browser/stages.spec.mjs
Known gaps
_No upstream requirement is recorded as not applicable._
Appearance
A list. One row for each stage, a hairline between rows. The mark is a circle the size of --se-icon-lg. Complete, it is --se-positive with the check the checkbox draws. Current, its edge is --se-accent. Not reached, its edge is --se-border-strong and the name is muted.
A rail. One segment for each stage on a single line, --se-space-1 tall with --se-space-1 between them. Complete segments are --se-accent, the current one is the accent mixed into the hairline by --se-mix-line, and the rest are --se-border. The place is beside them in --se-text-xs, muted.
| Token | Used for |
|---|---|
--se-accent | background-color, border-color |
--se-border | background-color, border-block-end |
--se-border-strong | border |
--se-border-width | border, border-block-end, border-width |
--se-duration-fast | transition |
--se-duration-slow | animation |
--se-ease-standard | transition |
--se-icon-lg | block-size, inline-size |
--se-mix-line | background-color |
--se-positive | background-color, border-color |
--se-radius-pill | border-radius |
--se-space-1 | block-size, gap |
--se-space-3 | column-gap, padding-block |
--se-space-4 | gap |
--se-text | color |
--se-text-muted | color |
--se-text-on-intent | background-color |
--se-text-sm | font-size |
--se-text-xs | font-size |
--se-weight-medium | font-weight |
Motion
The mark of a busy stage turns, on the Spinner's keyframes and at its pace. A mark changing color crosses --se-duration-fast. Under reduced motion the turn stops and the ring is left, as the Spinner's is. Segments never slide or grow.
Content
Name a stage for what happens in it. Statements, Review. Not Step 2.
A note says what the stage found, in a short clause. 60 files, 10 accounts.
Pass positionText in an app that is not in English. The default is 2 of 9 · Statements.
Usage
For a known number of stages. A wait of unknown length is a Spinner.
Not for how much of one job is done. That is Progress. Stages says which job.
A rail for a flow the reader walks through; a list for a job the reader watches.
Notes
Named Stages, not Steps. step is Spinbutton's part, and one word means one part everywhere. Stages holds stage, as Rows holds row. Salt calls its component Stepper, which meets the same part from the other side.
Not StageProgress. That name ends in a kind this is not: Progress is how much of one job is done.
The busy mark is not a Spinner inside the mark. A Spinner is a status region of its own, and a second one inside a list that already has one speaks twice. The mark takes the Spinner's keyframes and nothing else.
The check is the checkbox's. It is the same masked glyph, so the two cannot drift apart, and its ink is --se-text-on-intent.
The mark is --se-icon-lg, 24px. The prototype it was built for drew 22, which is between the icon boxes.
The rail's current segment is mixed by --se-mix-line, 60%. The prototype mixed at 55%. The mix the system has for a line is five points away, and a second share for one segment would be a second name.