Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rijvi-mahmud/shaddy/llms.txt
Use this file to discover all available pages before exploring further.
Stepper is a compound component that guides users through sequential, multi-step processes such as onboarding flows, checkout sequences, or multi-page forms. It renders a visual progress indicator row with numbered circles connected by lines, automatically marking completed steps with a green checkmark and errored steps with an alert icon. Navigation is handled by built-in Previous and Next / Complete buttons, and each Step can declare an async validate function that is run before advancing — keeping the user on the current step and displaying an error message if validation fails.
Installation
Install manually — dependencies
If you prefer to install by hand, start with the required npm package:
Usage
Basic usage
WrapStep children inside Stepper. The component counts the Step children automatically to determine the total number of steps.
With async validation and a completion callback
EachStep accepts an optional validate function. Return { hasError: true, message: "..." } to block navigation and display the error inline. The onComplete callback on Stepper is invoked when the user presses the final action button on the last step (after that step’s validate passes).
Accessing stepper state from inside a step
Use theuseStepperContext hook inside any component rendered within the stepper tree to read or update the current step programmatically:
API Reference
<Stepper>
The root component. Provides StepperContext to all descendants and renders the step indicator row, step content, and navigation controls.
One or more
<Step> components. The stepper counts only direct Step children to determine totalSteps; other React nodes are ignored in the count.Callback invoked when the user presses the action button on the final step and that step’s
validate function (if any) passes. Supports async functions — the button remains in its pressed state until the promise resolves.Label for the action button shown on the last step. Use a task-specific label such as
"Submit", "Place Order", or "Finish" for better UX.<Step>
Renders the content of a single step. Only the step matching the current currentStep index is visible at any time.
The content to display for this step — form fields, descriptive text, preview panels, or any React nodes.
Optional validation function called before advancing to the next step. Return
{ hasError: false } to allow navigation or { hasError: true, message: "..." } to block it. The message is rendered above the step content in a destructive text style.useStepperContext()
Hook that returns the live StepperContextType object. Must be called from within the Stepper component tree; throws if used outside a StepperContext.
Types
StepError
Return value of the Step validate function:
StepperContextType
Shape of the context object returned by useStepperContext:
Steps are 1-indexed throughout the API.
currentStep starts at 1, and stepErrors keys correspond to the 1-based step number.