Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Shadcn Steps for React and Tailwind

Steps in a wizard-like format.

Step 1

Installation

bunx --bun shadcn@latest add https://kit.dev/r/steps.json

Anatomy

Steps
├── StepsList
├── StepsItem
├── StepsTrigger
├── StepsIndicator
├── StepsSeparator
├── StepsContent
├── StepsNext
├── StepsPrevious
└── StepsProgress

Usage

import { ChevronLeftIcon, ChevronRight } from "lucide-react";
import { Button } from "@/components/ui/button";
import {
  Steps,
  StepsCompletedContent,
  StepsContent,
  StepsIndicator,
  StepsItem,
  StepsList,
  StepsNext,
  StepsPrevious,
  StepsSeparator,
  StepsTrigger,
} from "@/components/ui/steps";
const steps = Array.from({ length: 3 }, (_, index) => index + 1);

const StepsDemo = () => (
  <Steps className="size-full max-w-md" count={steps.length}>
    <StepsList>
      {steps.map((step) => (
        <StepsItem index={step - 1} key={step}>
          <StepsTrigger>
            <StepsIndicator>{step}</StepsIndicator>
          </StepsTrigger>
          <StepsSeparator />
        </StepsItem>
      ))}
    </StepsList>
    {steps.map((step) => (
      <StepsContent
        className="flex h-full items-center justify-center rounded-md border"
        index={step - 1}
        key={step}
      >
        <p className="text-muted-foreground text-sm">Step {step}</p>
      </StepsContent>
    ))}

    <StepsCompletedContent className="flex h-full items-center justify-center rounded-md border">
      <p className="text-muted-foreground text-sm">
        All steps completed. You&apos;re all set!
      </p>
    </StepsCompletedContent>

    <div className="flex flex-row-reverse gap-2">
      <StepsNext asChild>
        <Button>
          Next
          <ChevronRight />
        </Button>
      </StepsNext>
      <StepsPrevious asChild>
        <Button variant="outline">
          <ChevronLeftIcon />
          Back
        </Button>
      </StepsPrevious>
    </div>
  </Steps>
);

Accessibility

KeyDescription
Enter
Activate the focused control.
Space
Activate the focused control.

Demos

Controlled

Description

Icon

Loading

Title

Vertical

API Reference

Steps

div

PropType
AttributeType
CSS variableType

StepsList

div

PropType
AttributeType

StepsItem

div

PropType
AttributeType

StepsTrigger

button

PropType
AttributeType

StepsIndicator

div

PropType
AttributeType
CSS variableType

StepsSeparator

div

PropType
AttributeType
CSS variableType

StepsContent

div

PropType
AttributeType

StepsNext

button

PropType
AttributeType

StepsPrevious

button

PropType
AttributeType

StepsTitle

span

PropType
AttributeType

StepsDescription

span

PropType
AttributeType

StepsCompletedContent

div

PropType
AttributeType

useSteps

PropType