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 playgroundAbout
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
npm i @ashutoshswamy/smouiUsage
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.
numberdefault0- onChange
Called when you click back to a finished step.
(step: number) => void
More navigation components
- BreadcrumbsA trail that folds its middle into an ellipsis. Press it and the hidden crumbs spring out in order.
- DockIcons swell around the cursor and settle back on a spring.
- FlyoutNavOne panel that follows you. Move between items and it glides sideways and resizes to the new content while the content cross-fades.
- GooMenuA plus that throws its items out as liquid bubbles and fuses them back on close.
- MorphTooltipOne tooltip for the whole toolbar. It stretches to the next tool and resizes to its label.
- PaginationOne accent pill slides to the page you pick. Long lists fold into ellipses that follow the current page.