Stepper whose marker is a ball that rolls along the connector to the next step while the fill follows it, and completed steps draw their check.
Click meTap me
Set up workspace
Four steps, about two minutes.
0Details, completed
0Members, completed
0Defaults, completed
0Review, completed
1 of 5 seats used on this plan.
They join as members; you can change roles later.
stepper · , lively
stepper-demo.tsx
When to use
Use it for flows split into a few ordered steps: setup, import, checkout, onboarding. It shows done, current and next steps, animates between content panels, and your Next handler can validate and keep people on the step.
When not to use
To switch between views of the same object use Tabs. For a single progress value use Progress.
Use a stepper for flows split into a few ordered steps: workspace setup, an import wizard, a checkout, an onboarding checklist. It says where people are, what is done and what comes next. For switching between views of the same object, use tabs; for a single progress value, use a progress bar.
The motion follows the three beats. Pressing Next (or a reachable step) charges: the ball stretches toward the destination and the current content sinks slightly. On release it acts: the ball is thrown along the connector, the fill grows behind it with its leading edge on the ball, and the step it leaves fills its ring and draws a check. The new content arrives from the direction of travel. It settles by squashing against the new ring, then rounding. Going back, the ball rolls back, the fill retreats and the check erases in the first 40% of the trip. An error is calm whatever the temperament: the ring and the ball turn destructive, and Next only makes the ball press against its ring without leaving.
Stepper holds the state: controlled with value and onValueChange, or uncontrolled with defaultValue. linear (default true) only lets people click completed steps; linear={false} lets them jump anywhere.
StepperList is the ol with the connector, the fill and the one ball. Name it with aria-label.
StepperStep takes value, label, description, optional, disabled, icon and status ("error" or "loading"). In the vertical preset its children are the step's content, shown under the label while the step is current.
StepperContent panels go in one relative container; the leaving panel is popped out of the flow during its exit. forceMount keeps a panel mounted (hidden) so a form keeps its state.
StepperNext and StepperPrevious run your onClick first: validate there and call event.preventDefault() to stay on the step (set status="error" to show why). useStepper() returns { value, index, count, next, previous, goTo, isFirst, isLast, status } for custom controls.
preset picks the layout (horizontal, vertical, compact), size the rings (sm 24 px with a 10 px ball, md 28 px with a 12 px ball). Payments and checkouts should pass temperament="calm".
The default demo above: a four-step form built with text fields. Next validates the current step in its onClick; clear the email and press Next to see the error state. Under a 480 px container only the current label stays on screen, on one line over its hidden neighbours (flush left on the first step, flush right on the last); the others remain for screen readers.
A settings page checklist. The ball rolls down the rail, and each step's content opens under its label while the previous one closes on the calm spring.
A capsule "Step 2 of 3 · Payment" with an inner track where the ball marks progress and the number rolls. Below a 360 px container the capsule reads "2 of 3 · Payment" so the step label stays whole on phones. Payments are calm by rule.
Click meTap me
Upgrade to Team plan
Step1101234567891of 0·
Plan, completed
Payment, completed
Confirm, completed
stepper · , lively
stepper-compact-demo.tsx
On the last step the demo swaps Continue for the final action (Pay), read from useStepper().isLast.
A data import while the file is checked: status="loading" turns an arc around the ring, charges the ball toward the next step and disables Next. A disabled step is dimmed and never focusable.
Click meTap me
Import contacts
contacts-export.csv · 1,240 rows
0Upload1,240 rows, completed
0ValidateChecking columns, completed
0Review, completed
0ScheduleTeam plan, completed
Rows are matched to existing contacts by email. You can review changes before anything is saved.
An ol named by aria-label; the current li has aria-current="step". Reachable steps are buttons (ring and label in one target), unreachable ones are not focusable.
Each step ends with a visually hidden status: "completed", "current", "not started", "checking" or error: <description>. Status is never color only (check, ring, text).
The connector, the fill and the ball are aria-hidden. In the compact preset the capsule is aria-hidden and the list is visually hidden, so readers get the full list.
A polite live region announces "Step 3 of 4: Review" on every change, and the error message when the current step errors. A loading step has aria-busy.
After Next or Back, focus moves to the new content (focusOnChange, default true), so keyboard and screen-reader users start reading the new step. A click on a step keeps focus on it.
Labels use foreground (current) and muted-foreground (others) on background; the check is primary-foreground on primary.
With reduced motion (the OS setting, or MotionKitProvider reducedMotion="always") there is no charge, no content sink and no squash. The ball still glides to the new step in the short fade time so the eye can follow the progress, and the fill follows it. The completed check fades in whole instead of drawing, and the content crossfades in place. The resting stepper is the animated version's last frame: checks, filled connector, the ball in the current ring.
The ball and the fill move with transform from motion values; the fill is a scale of one full-length pill derived from the ball's position, so there is a single spring.
Ring centers are measured from layout on change and by a ResizeObserver; in the vertical preset the ball follows rings that move while content opens.
The only loop is the loading arc (one turn per second, CSS), paused off screen and in hidden tabs.
No lazy-loaded parts; the only peer is motion.
Technical sheet
Motion
calm
260 ms · bounce 0
lively
400 ms · bounce 0.3
playful
540 ms · bounce 0.45
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Size
Not measured yet · budget 15.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom, motion.
Dependencies
motion · peer
Triggers
click, press, keyboard focus
Reduced motion
No charge, sink or squash: the ball glides to the new step in the fade time with the fill following, the completed check fades in whole and the content crossfades in place.
Keyboard
Tab
Focuses the current step (one tab stop), then the content and the Back / Next buttons