StepIndicator
Where the reader is in a flow spread over several pages, such as payee, amount and review.
View code
<StepIndicator label="Transfer steps">
<StepIndicator.Step number={1} state="complete" href="/transfer">Payee</StepIndicator.Step>
<StepIndicator.Step number={2} state="current">Amount</StepIndicator.Step>
<StepIndicator.Step number={3} state="upcoming">Review</StepIndicator.Step>
</StepIndicator>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Or copy it into your project to edit it:
sdxc ui add step-indicatorUsage
import { StepIndicator } from "@sdxc/ui";Renders the row of steps as an ordered list in a nav spanning its container, so a
screen reader announces how many steps there are and which one is current.
Composition
The parts the component publishes, each a static property of the host.
StepIndicatorStepIndicator.StepRenders one step: its number (a check once done) in a circle, then its name, with a line leading in from the step before.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Required | Description |
|---|---|---|---|
label | string | Yes | The landmark's name, such as "Transfer steps". |
children | RemixNode | Yes | StepIndicator.Steps in order. |
Also accepts everything in TagProps<"nav">.
StepIndicator.Step
| Prop | Type | Required | Description |
|---|---|---|---|
number | number | Yes | The step's place in the flow, from 1. |
state | "complete" | "current" | "upcoming" | Yes | |
href | string | No | The address of a done step, so the reader can go back and change it. |
children | RemixNode | Yes | The step's name. |
Also accepts everything in Omit<TagProps<"li">, "children">.
Types
| Name | Values | What it decides |
|---|---|---|
State | "complete" | "current" | "upcoming" | Where a step stands: behind the reader, where they are, or still ahead. |