Skip to content

shadcn.io is not affiliated with official shadcn/ui

Shadcn Steps for React Radix UI

Steps in a wizard-like format.

Framework
UI library

Radix UI does not include this primitive, so this page uses the Ark UI component. The visuals match the Ark UI version.

Step 1

Installation

bunx --bun shadcn@latest add https://kit.dev/r/radix/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
--percentstring

StepsList

div

PropType
AttributeType

StepsItem

div

PropType
indexnumber
AttributeType

StepsTrigger

button

PropType
AttributeType

StepsIndicator

div

PropType
AttributeType
CSS variableType
--steps-icon-sizestring
--steps-sizestring

StepsSeparator

div

PropType
AttributeType
CSS variableType
--steps-gutterstring
--steps-sizestring

StepsContent

div

PropType
indexnumber
AttributeType

StepsNext

button

PropType
AttributeType

StepsPrevious

button

PropType
AttributeType

StepsTitle

span

PropType
AttributeType

StepsDescription

span

PropType
AttributeType

StepsCompletedContent

div

PropType
AttributeType

useSteps

PropType