Shadcn Stepper
A decoupled multi-step tracker (Stepper) and sliding content container (StepperContent) built on CSS transitions and the Web Animations API.
About Shadcn Stepper
What it is. Stepper (the visual progress bar/step indicators) and StepperContent (the bidirectional sliding step body) share a steps array and a zero-indexed currentStep number.
How it is built. Built with plain CSS transitions and the Web Animations API (no animation library dependency). Stepper and StepperContent are decoupled so you can keep form state, per-step validation, and async submit handling in your own component.
When to use it. Use Stepper for multi-step checkout, onboarding, and setup flows with horizontal step indicators. For a Typeform-style vertical question wizard, use Wizard.
For AI agents
Hand your agent this brief or the Markdown page, not a screenshot.
When to use
- Multi-step forms and onboarding flows with a horizontal progress header (
Stepper) and sliding panels (StepperContent) - Standalone progress headers (
StepperwithoutStepperContent)
When not to use
- Full-screen Typeform-style vertical question flows — use Wizard
- Narrative feature decks — use Split Stepper
Agent notes
- Named exports:
Stepper,StepperContent,type Stepfrom@/components/custom/blocks/StepperBlock - Omit
onStepChangeto render static non-clickable step indicators; pass a CSS color value (not a Tailwind class) tocolorso the active pulse ring renders
- Markdown
- /docs-md/nextjs-stepper.md
- Install
npx shadcn@latest add https://avaraui.com/r/stepper.json- Registry name
@avara-ui/stepper, through the shadcn MCP server- Index
- llms.txt lists every page, or add the agent skill once
Props Reference
Stepper
The visual navigation header component that renders step indicators and the animated progress fill line.
| Prop | Type | Default | Description |
|---|---|---|---|
steps | Step[] | Required | An array of step objects defining the sequence. Each object requires an |
currentStep | number | Required | The active zero-indexed step of the sequence. Controls the progress line fill and active/completed indicator states. |
onStepChange | (step: number) => void | undefined | Callback fired when a user clicks directly on a step circle in the header. If omitted, the steps become static visual indicators. |
color | string | "var(--primary)" | The active theme color for the progress line, active/completed circles and pulse ring. Supports any CSS color value or Tailwind background class. |
className | string | undefined | Custom Tailwind CSS classes to apply to the outermost navigation header wrapper. |
StepperContent
The sliding content container component that handles the animated sliding entrance of each step payload.
| Prop | Type | Default | Description |
|---|---|---|---|
steps | Step[] | Required | The identical array passed to the header component. Renders the active step's |
currentStep | number | Required | The active zero-indexed step used to identify which payload to render and determine the sliding transition direction. |
className | string | undefined | Custom Tailwind CSS classes applied to the sliding content wrapper container. |
Step (TypeScript Interface)
The TypeScript interface defining the structure of each object in the steps array prop.
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | A unique identifier string required for safe React list rendering. |
title | string | Yes | Primary headline text displayed prominently below the step circle indicator. |
description | string | No | Optional secondary helper text displayed directly underneath the step title on larger screens. |
icon | React.ElementType | No | Optional Lucide React icon or custom SVG component rendered inside the step circle indicator instead of a default number. |
content | React.ReactNode | No | The JSX/UI payload (e.g., input forms, review summaries) rendered inside |
Works with other components
- Render Input, Select, and Radio Button inside
StepperContentpanels. - Pair final-step submission with Sonner or Alert.
How do I build a multi-step form wizard in React?
Render Stepper for the progress header and StepperContent for the step body, and give both the same steps array and a zero-indexed currentStep that you keep in state. Increase or decrease currentStep from your own Back and Next buttons.
Do I have to use StepperContent with Stepper?
No. Stepper is the header only and works on its own, and StepperContent is the sliding body that reads the same steps and currentStep. Pair them when you want each step's content to slide in and out, and skip it for a bare progress tracker.
How do I let users click a step to jump to it?
Pass onStepChange. It fires with the clicked step's index when a user clicks a step circle in the header, and you set currentStep from it. If you omit it, the circles become static indicators and the user can only move with your own buttons.
What fields does a step object have?
A step needs id and title. description is helper text under the title on larger screens, icon is an optional Lucide icon or SVG component shown instead of the number, and content is the node that StepperContent renders when that step is active.
How do I change the stepper colour and does it animate?
Set color to any CSS colour or Tailwind background class. It colours the progress line, active and completed circles and the pulse ring, and defaults to var(--primary). Movement uses CSS transitions and the Web Animations API, and StepperContent slides in both directions.