For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
Shadcn Labs/

Step Wizard

A multi-step form whose panels slide in the direction you move and whose progress indicator glides between steps. A React component built on View Transitions, installed with the shadcn CLI.

Name your workspace

You can change it later in settings.

Installation

$ pnpm dlx shadcn@latest add @transition-kit/step-wizard

Usage

import {
  StepWizard,
  StepWizardContent,
  StepWizardDescription,
  StepWizardIndicator,
  StepWizardNext,
  StepWizardPrevious,
  StepWizardStep,
  StepWizardTitle,
} from "@/components/transitions/step-wizard";
<StepWizard>
  <StepWizardIndicator />
  <StepWizardContent>
    <StepWizardStep label="Account" canAdvance={email !== ""}>
      <StepWizardTitle>Create your account</StepWizardTitle>
      <StepWizardDescription>
        We'll send a confirmation link.
      </StepWizardDescription>
      <Input value={email} onChange={(event) => setEmail(event.target.value)} />
    </StepWizardStep>
    <StepWizardStep label="Plan">…</StepWizardStep>
    <StepWizardStep label="Review">…</StepWizardStep>
  </StepWizardContent>
  <div className="flex justify-between">
    <StepWizardPrevious />
    <StepWizardNext />
  </div>
</StepWizard>
const { step, count, next, previous, goTo, isFirst, isLast } = useStepWizard();

API Reference

StepWizard

PropTypeDefaultDescription
stepnumber-Controlled step index.
defaultStepnumber0Initial step index when uncontrolled.
onStepChange(step: number) => void-Called with the target step after navigation.

StepWizardStep

PropTypeDefaultDescription
labelstring"Step <n>"Shown in the indicator and used as the step's accessible name.
canAdvanceboolean | (() => boolean)truefalse blocks Next; a function runs when Next is pressed and blocks it by returning false.
aria-labelstring"<label> (n of N)"Accessible name override for the step group.

useStepWizard

ReturnTypeDescription
stepnumberThe current step index.
countnumberThe total number of steps.
goTo(step: number) => voidMoves to the step index.
next() => voidMoves forward unless canAdvance blocks it.
previous() => voidMoves back one step.
isFirstbooleanWhether the first step is active.
isLastbooleanWhether the last step is active.