Components
Loading preview...
A step-by-step process for users to navigate through a series of steps.
npx shadcn@latest add https://21st.dev/r/sean0205/stepperimport {
Stepper,
StepperContent,
StepperIndicator,
StepperItem,
StepperNav,
StepperPanel,
StepperTitle,
StepperTrigger,
} from '@/components/ui/stepper';
const steps = [{ title: 'User Details' }, { title: 'Payment Info' }, { title: 'Auth OTP' }, { title: 'Preview Form' }];
export default function Component() {
return (
<div className="flex flex-col gap-5 p-10 w-full mx-auto max-w-[600px] h-screen justify-center items-center">
<Stepper defaultValue={2} className="space-y-8">
<StepperNav className="gap-3.5 mb-15">
{steps.map((step, index) => {
return (
<StepperItem key={index} step={index + 1} className="relative flex-1 items-start">
<StepperTrigger className="flex flex-col items-start justify-center gap-3.5 grow">
<StepperIndicator className="bg-border rounded-full h-1 w-full data-[state=active]:bg-primary"></StepperIndicator>
<div className="flex flex-col items-start gap-1">
<StepperTitle className="text-start font-semibold group-data-[state=inactive]/step:text-muted-foreground">
{step.title}
</StepperTitle>
</div>
</StepperTrigger>
</StepperItem>
);
})}
</StepperNav>
<StepperPanel className="text-sm">
{steps.map((step, index) => (
<StepperContent key={index} value={index + 1} className="flex items-center justify-center">
Step {step.title} content
</StepperContent>
))}
</StepperPanel>
</Stepper>
</div>
);
}