ui · Primitive
Stepper / Step
@devalok/shilp-sutra/ui/stepperView in Storybook Hand-curated previews ship in rolling waves. See it live in Storybook →
Reference
Props
Stepper
activeStep: number (REQUIRED, 0-indexed)
orientation: "horizontal" | "vertical"
children: <Step> elements
Step
label: string (REQUIRED)
description: string
icon: ReactNode (overrides default number/checkmark)
Defaults
orientation: "horizontal"
StepperContent
activeStep: number (REQUIRED, 0-indexed — matches Stepper's activeStep)
children: ReactNode (one child per step, only the active one is visible)
className: string
Compound Components
Stepper (root)
Step (label, description, icon)
StepperContent (content panel, animates active step)
Example
<Stepper activeStep={1}>
<Step label="Account" description="Create credentials" />
<Step label="Profile" description="Add details" />
<Step label="Review" />
</Stepper>
Composability
StepperpassesactiveStep+orientation+ each step's index down to everyStepchild viaStepperContext. Each Step derives its own status (completed / active / pending) from its position vsactiveStep.- Step index is assigned by position in children — order matters. Don't conditionally render Steps via
&&or.filter(); it shifts the indices and breaks the active highlight. StepperContentis separate fromStepper— it's the animated panel surface that shows one child per step index. Pass the sameactiveStepvalue to both.orientation="vertical"swaps the Step layout (stacked with connecting line on the left) AND changes how StepperContent animates (vertical crossfade instead of horizontal slide).- Custom icons via
Step.iconoverride the default number/checkmark — the icon slot still receives the status-based styling (muted for pending, accent for active/completed).
Gotchas
- Steps before activeStep are "completed", at activeStep is "active", after is "pending"
- Don't conditionally render Step children — position is the index contract
Changes
v0.18.0
- Fixed
bg-interactivechanged tobg-accent-9(OKLCH migration) - Fixed Wrapped Stepper context provider value in
useMemofor performance
v0.1.0
- Added Initial release