Components / feedback

Stages

Where a person or a job stands in a sequence of named stages.

Rendered from the package · open on its own

Summary

Where a person or a job stands in a sequence of named stages.

APG patternnone
Built onnative elements
Statusself-tested
Since0.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.

PartElementRequired
label<span>yes
list<ol>yes
mark<span>yes
note<span>no
position<p>yes
sr<span>no
stage<li>yes

Properties

PropertyValuesDefaultWhat it does
stagesStagesStage[]requiredThe stages, in order.
currentnumberrequiredWhich stage this is, counted from 0. Every stage before it is complete. Equal to the number of stages, all of them are.
busybooleannoneThe current stage is a job that is running, not a screen the reader is on. Its mark turns.
kindlist · raillistlist 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.
labelstringrequiredThe name of the sequence: First run, Reading your statements. Not drawn.
positionTextstringnoneThe 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.
completeTextstringcompleteThe word read after a complete stage's name.
busyTextstringin progressThe words read after the current stage's name while busy is set.

States

StateExpressed as
Busyaria-busy
Currentaria-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

AttributeSet by
aria-busyset at render
aria-currentset at render
aria-hiddenset at render, always true
aria-labelset at render
rolealways 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.jsx
  • test/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.

TokenUsed for
--se-accentbackground-color, border-color
--se-borderbackground-color, border-block-end
--se-border-strongborder
--se-border-widthborder, border-block-end, border-width
--se-duration-fasttransition
--se-duration-slowanimation
--se-ease-standardtransition
--se-icon-lgblock-size, inline-size
--se-mix-linebackground-color
--se-positivebackground-color, border-color
--se-radius-pillborder-radius
--se-space-1block-size, gap
--se-space-3column-gap, padding-block
--se-space-4gap
--se-textcolor
--se-text-mutedcolor
--se-text-on-intentbackground-color
--se-text-smfont-size
--se-text-xsfont-size
--se-weight-mediumfont-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.