Skip to content
Cojeev UI

Stepper

Navigation

Tracks the current stage of a multi-step sequence and provides previous and next controls.

React · copy into your project · light and dark themes

Try it

Loading preview…

Take it with you

Copy the example, API and usage notes for your editor or AI assistant.

Add to your project

Terminal
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/stepper.json

The command includes the component’s shared dependencies. Your project keeps editable source files.

Using stepper

  • Set count and optional labels, then use one-based values for StepperItem parts.

  • Use onValueChange to switch your content and gate progression with your own validation before advancing.

  • StepperList orientation="horizontal" lays out connected milestones with native Previous/Next controls. The default remains vertical. Completed milestones use a native validation icon.

API

Compose the exported parts below. The prop types are read from the React source during the registry build.

Native element or underlying primitive props are inherited where declared, including accessible labels, event handlers and refs.

StepperProps

PropTypeRequired
defaultValuestring | number | readonly string[] | undefinedNo
valuenumberNo
countnumberYes
labelsstring[]No
onValueChange(value: number) => voidNo

StepperListProps

PropTypeRequired
orientation"vertical" | "horizontal"No

StepperItemProps

PropTypeRequired
stepnumberYes

StepperIndicatorProps

PropTypeRequired
stepnumberYes

StepperTitleProps

Accepts the native or primitive props declared by its exported TypeScript type.

StepperPreviousProps

Accepts the native or primitive props declared by its exported TypeScript type.

StepperNextProps

Accepts the native or primitive props declared by its exported TypeScript type.

StepperStatusProps

Accepts the native or primitive props declared by its exported TypeScript type.

Accessibility

  • The current item exposes aria-current="step"; use meaningful titles and include StepperStatus when a spoken progress update is useful.

States and appearance

selectedresthoverfocusactive

For conditional content, keep a MotionPresence boundary around keyed MotionSurface children. The shared entrance and exit states work with native primitives and respect your motion preference.

Try pointer and keyboard interaction, and switch the appearance control in the navigation to compare light and dark mode. Motion respects reduced motion preferences.