Installation
Usage
import {
WizardStepper,
WizardStepData,
} from "@/components/ruixen/wizard-stepper";const steps: WizardStepData[] = [
{ id: 1, title: "Account", description: "Create your account" },
{ id: 2, title: "Profile", description: "Set up your profile" },
{ id: 3, title: "Preferences", description: "Customize settings" },
{ id: 4, title: "Complete", description: "Review and finish" },
];
<WizardStepper steps={steps} currentStep={1} onStepChange={setStep} />;Examples
With Descriptions
const steps = [
{ id: 1, title: "Account", description: "Create your account" },
{ id: 2, title: "Profile", description: "Set up your profile" },
{ id: 3, title: "Complete", description: "Review and finish" },
];
<WizardStepper steps={steps} currentStep={1} />;Vertical Layout
<WizardStepper steps={steps} currentStep={2} orientation="vertical" />With Loading State
<WizardStepper steps={steps} currentStep={1} loading={isLoading} />Simple Labels Only
const steps = [
{ id: 1, title: "Welcome" },
{ id: 2, title: "Setup" },
{ id: 3, title: "Done" },
];
<WizardStepper steps={steps} currentStep={0} />;Props
WizardStepper
| Prop | Type | Default | Description |
|---|---|---|---|
steps | WizardStepData[] | Required | Array of step definitions |
defaultStep | number | 0 | Default active step index |
currentStep | number | - | Controlled active step |
onStepChange | (step: number) => void | - | Callback when step changes |
loading | boolean | false | Show loading spinner |
orientation | "horizontal" | "vertical" | "horizontal" | Layout orientation |
WizardStepData
| Property | Type | Description |
|---|---|---|
id | string | number | Unique identifier |
title | string | Step title |
description | string | Optional description |

