Skip to content

Components

<Stepper>

The main container component.

Props

NameTypeDefaultDescription
onComplete() => voidRequiredCallback fired when the user completes the final step.
childrenReactNodeRequiredThe step components.
onCancel() => voidundefinedCallback fired when canceling (Escape or goBack() on the first step, or a stepContext.cancel() call).
onStepChange(step: number) => voidundefinedCallback fired when the active step index changes.
onEnterStep(step: number) => voidundefinedCallback fired after entering a new step.
onExitStep(step: number) => void | boolean | Promise<void | boolean>undefinedCallback fired before leaving a step. Return false to prevent navigation; no return value is needed otherwise.
onError(error: unknown) => voidundefinedCalled when an async canProceed or onExitStep callback throws or rejects. Navigation is blocked in that case. When omitted, the error is logged via console.error.
stepnumberundefinedIf provided, puts the stepper in controlled mode.
initialStepnumber0Starting step index for uncontrolled mode. Ignored when step is provided.
keyboardNavbooleantrueWhether to enable built-in Enter/Escape navigation.
showProgressbooleantrueWhether to display the progress bar.
renderProgress(ctx: ProgressContext) => ReactNodeundefinedCustom renderer for the progress bar.
markersStepperMarkersundefinedCustom configuration for progress bar symbols.
pulsebooleanfalsePulse the current-step marker's brightness (bright → normal → dim → normal, spinner-style). Ignored when renderProgress is provided.

<Step>

Represents a single step in the wizard.

Props

NameTypeDefaultDescription
namestringRequiredThe display name of the step (used in the progress bar).
childrenReactNode | (ctx: StepContext) => ReactNodeRequiredThe content of the step. Can be a function to access navigation controls.
canProceedboolean | (() => boolean | Promise<boolean>)trueWhether navigation to the next step is allowed. Can be a boolean or an (async) function.

Example

tsx
<Step name="Verification" canProceed={isVerified}>
  <Text>Please verify your identity.</Text>
</Step>

Ordering

Steps sort by their position in the element tree, not by the time they mounted, so a conditionally rendered <Step> that appears later still occupies its JSX position.

WARNING

A <Step> must not be nested inside another <Step> — that breaks the tree-order guarantee. Wrapper components, fragments, and conditionals around a <Step> are supported.

Released under the MIT License.