Stepper

Progress steps. The bar between them fills on a spring, finished steps draw a tick, and you can click back to them. Navigation.

Open playground

About

Stepper is a React component in the Navigation category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { Stepper } from "@ashutoshswamy/smoui" and set steps, current, defaultCurrent among its 4 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { Stepper } from "@ashutoshswamy/smoui";

<Stepper steps={["Account", "Plan", "Payment", "Done"]} current={step} onChange={setStep} />

Props 4

steps

Step labels.

string[]
current

Controlled, zero-based current step.

number
defaultCurrent

Initial step when uncontrolled.

numberdefault 0
onChange

Called when you click back to a finished step.

(step: number) => void