stepper-description

PreviousNext
Docs
reuicomponent

Preview

Loading preview…
registry/default/components/stepper/description.tsx
import {
  Stepper,
  StepperContent,
  StepperIndicator,
  StepperItem,
  StepperNav,
  StepperPanel,
  StepperSeparator,
  StepperTrigger,
} from '@/registry/default/ui/stepper';

const steps = [1, 2, 3, 4];

export default function Component() {
  return (
    <Stepper defaultValue={2} className="space-y-8">
      <StepperNav>
        {steps.map((step) => (
          <StepperItem key={step} step={step}>
            <StepperTrigger>
              <StepperIndicator>{step}</StepperIndicator>
            </StepperTrigger>
            {steps.length > step && <StepperSeparator />}
          </StepperItem>
        ))}
      </StepperNav>

      <StepperPanel className="text-sm">
        {steps.map((step) => (
          <StepperContent key={step} value={step} className="flex items-center justify-center">
            Step {step} content
          </StepperContent>
        ))}
      </StepperPanel>
    </Stepper>
  );
}

Installation

npx shadcn@latest add @reui/stepper-description

Usage

import { StepperDescription } from "@/components/stepper-description"
<StepperDescription />