The stepper instance
Understand the object that drives state, navigation, and rendering.
The stepper instance
useStepper() returns a single flat object. Everything you read (current step,
index, progress) and everything you do (navigate, save values, complete steps)
lives directly on it — no nested state or navigation namespaces.
The fastest way to understand it is to drive one. Click the controls below and watch every value react in real time.
Stepper UI
Account
Step 1 of 4. Collect the sign-in details for this flow.
Current position
You're at the beginning, so Stepperize blocks backward movement.
Progress
0 of 4 completed
Understanding this state
First step
Previous navigation is disabled.
Not last
Another step is still ahead.
Back disabled
There is no earlier step to visit.
Can continue
The Next button can move.
Completed steps
0 / 4No completed steps yet
Recent updates
state changesFlow ready
Account is the starting step.
What just happened
next()/prev()move the active step. Noticeindex,progress, and thecurrent.idchange together — they are all derived from one source.canPrev/canNextflip automatically at the edges. You never compute "am I on the last step?" yourself — bind buttons straight to them.setComplete()changescompletedbut leaves the position untouched. Completion is independent from where you are — see Status vs completion.goTo(id)(click any circle) jumps directly to a step by its typed id.
The mental model
Think of the instance as derived state over one pointer. You move the
pointer (the current index); everything else — current, progress, isLast,
each step's status — is recomputed for you.
const stepper = onboarding.useStepper();
stepper.current; // the active step object (with your custom fields)
stepper.index; // where the pointer is
stepper.next(); // move the pointer forward
stepper.match({ ... }); // render exactly the active stepYou only manage intent ("go next", "jump to review"). Stepperize manages the consequences.
The six you need on day one
Most flows ship with just these:
| Member | What it gives you |
|---|---|
current | The active step object, including your custom fields. |
match({...}) | Exhaustive, type-checked rendering by step id. |
next() / prev() | Move through the flow. |
canNext / canPrev | Ready-made disabled states for your buttons. |
Everything else — values, completion, events, step-map helpers — is there when you need it, and invisible until then. The full instance reference lists every member.
Next: the navigation lifecycle.
Last updated on