FEEDBACK
Stepper
The progress rail for a wizard. Finished steps are clickable, steps ahead never are.
PREVIEW
Finished steps are clickable so you can go back. Steps ahead never are — forward navigation stays with the form, which is the only thing that knows whether this step validates.
SOURCE
import { Stepper, type Step } from '@objectifthunes/whiteboard'
const STEPS: Step[] = [
{ id: 'account', label: 'Account', hint: 'Name and email' },
{ id: 'workspace', label: 'Workspace', hint: 'Name and region' },
{ id: 'done', label: 'Finish' },
]
<Stepper steps={STEPS} current={step} onStepClick={setStep} />
<Stepper steps={STEPS} current={step} direction="vertical" /> {/* read-only rail */}NOTES
Steps before current are marked done and, with onStepClick, are the only ones you can click. Forward navigation stays with the form, which is the only thing that knows whether the current step validates.
Omit onStepClick for a read-only rail. Done steps carry a solid connector, so progress reads as a filled track rather than a row of disconnected circles.
horizontal sits above the form; vertical suits a sidebar, where the hints have room to be useful.