SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

StepIndicator

Where the reader is in a flow spread over several pages, such as payee, amount and review.

View code
tsx
<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.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Or copy it into your project to edit it:

Terminal
sdxc ui add step-indicator

Usage

typescript
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.

  • StepIndicator
  • StepIndicator.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.

PropTypeRequiredDescription
labelstringYesThe landmark's name, such as "Transfer steps".
childrenRemixNodeYesStepIndicator.Steps in order.

Also accepts everything in TagProps<"nav">.

StepIndicator.Step

PropTypeRequiredDescription
numbernumberYesThe step's place in the flow, from 1.
state"complete" | "current" | "upcoming"Yes
hrefstringNoThe address of a done step, so the reader can go back and change it.
childrenRemixNodeYesThe step's name.

Also accepts everything in Omit<TagProps<"li">, "children">.

Types

NameValuesWhat it decides
State"complete" | "current" | "upcoming"Where a step stands: behind the reader, where they are, or still ahead.
@sdxc/ui

Can’t find it? Contact us