Rost

← All components

component

Stepper

Where someone is in a few steps, and how many are left. The steps in a row, a short line between each.

In code Contract: review Guidance: proposed Contract on GitHub Figma 744:31 As markdown
  1. Details, done
  2. Bank
  3. Review
Default

Install

npx github:Runceanu/rost add stepper

It lands in src/rost/stepper/, with what it needs and its contract. Install has the rest.

When to use

  • A few steps in order

    Three to five steps that build on each other: setting up a vault, closing a year.

When not to use

Behaviour

It lays out the Steps and the lines between them. Each Step knows whether it's done, current or still to come.

Accessibility

  • Element

    <ol>, so the steps are counted. The current Step has aria-current="step".

  • Name

    Progress, or what the steps are for.

Props

PropTypeValuesDefault
children slot

Values

Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.

Never changes

root

  • gap 8px spacing/gap/small
  • padding 0px spacing/gap/none

displayflex · align-itemscenter · list-stylenone

connector

  • width 24px spacing/size/small
  • height 1px spacing/outline/small
  • background #3a3a3a stepper/connector

displayblock · flex-shrink0

Part of Stepper

Step

One step of a Stepper: a 24px marker and its name. A green tick when done, a green ring when current, grey when it is still to come.

In code Contract: review Guidance: proposed Contract on GitHub Figma 744:30 As markdown
  1. Details, done
Done
  1. Bank
Current
  1. Review
Upcoming

Install

npx github:Runceanu/rost add step

It lands in src/rost/step/, with what it needs and its contract. Install has the rest.

When to use

  • Done, here, to come

    Each step says which it is: a tick for done, a green ring for where you are, grey for what's left.

When not to use

  • Steps you can press

    A Step isn't a button. If going back is allowed, put a Back button in the form.

Behaviour

Done shows a dark tick on green, current a green ring and number, upcoming a grey ring and number. The words say the same as the colours.

Accessibility

  • Element

    <li>; the current one has aria-current="step". A done Step says Done in hidden text, since the tick replaces its number.

  • Colour

    The upcoming ring is 4.3:1 on the dark page, the numbers and names 7:1 or more.

Props

PropTypeValuesDefault
status enum done · current · upcoming upcoming
number number
children slot

Values

Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.

Never changes

root

  • gap 8px spacing/gap/small

displayinline-flex · align-itemscenter

marker

  • width 24px spacing/size/small
  • height 24px spacing/size/small
  • border-radius 10000px spacing/radius/full
  • outline-offset calc(-1 * var(--spacing-outline-medium)) on purpose: Composed from a token: the edge sits inside the marker.
  • font-family 'General Sans Variable' font-family/base
  • font-weight 500 typography/label/font-weight/medium
  • font-size 12px typography/label/font-size
  • line-height 14px typography/label/line-height
  • letter-spacing 0px typography/label/letter-spacing

displayinline-flex · align-itemscenter · justify-contentcenter · positionrelative · flex-shrink0 · outline-stylesolid

check

  • width 16px spacing/size/2xsmall
  • height 16px spacing/size/2xsmall
  • mask url(./icon-check.svg) center / contain no-repeat on purpose: The icon file itself.

displayblock

label

  • font-family 'General Sans Variable' font-family/base
  • font-weight 400 typography/paragraph/font-weight/regular
  • font-size 14px typography/paragraph/font-size
  • line-height 20px typography/paragraph/line-height
  • letter-spacing 0px typography/paragraph/letter-spacing

white-spacenowrap

Changes by variant

3 variants. Each table is what one thing changes with: a column per status, a row per property. Where every row starts with the same token path, it's written once, under the property.

Follows status

PropertyDoneCurrentUpcoming
label.colorstep/… done/label #d3d9d5 current/label #ededed upcoming/label #999999
marker.background step/done/marker #00d669 transparent transparent
marker.outline-colorstep/… done/marker #00d669 current/edge #00d669 upcoming/edge #747573
marker.outline-widthspacing/outline/… medium 2px medium 2px small 1px

All but Done

PropertyCurrentUpcoming
marker.colorstep/… current/number #00d669 upcoming/number #999999

Only in some variants

These don't change: they're just set in some variants and not others.

Done

  • check.background #060805 step/done/check