Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

Stepper

A multi-step progress indicator for wizards, checkouts and onboarding flows, horizontal or vertical.

Installation

npx logic2b@next add stepper

Usage

import {
  Stepper,
  StepperIndicator,
  StepperItem,
  StepperSeparator,
  StepperTitle,
  StepperTrigger,
} from "@/components/ui/stepper"

<Stepper defaultValue={1}>
  <StepperItem step={1}>
    <StepperTrigger>
      <StepperIndicator />
      <StepperTitle>Account</StepperTitle>
    </StepperTrigger>
    <StepperSeparator />
  </StepperItem>
  <StepperItem step={2}>
    <StepperTrigger>
      <StepperIndicator />
      <StepperTitle>Confirm</StepperTitle>
    </StepperTrigger>
  </StepperItem>
</Stepper>

Each step derives its state from the root value: steps below it are completed (the indicator swaps to a check), the matching step is active (and carries aria-current="step"), the rest are upcoming.

Examples

Vertical

Set orientation="vertical" for tall flows — separators become connector lines between the indicators, with room for descriptions.

Accessibility

  • Rendered as an ordered list (<ol>/<li>), so the step count and order are announced natively.
  • The active step exposes aria-current="step".
  • Triggers are real buttons: focusable, disabled when the item is disabled, and the completed/active/upcoming state rides on data-state for styling only.
  • Separators are aria-hidden — purely decorative.

Live playground

Edit the component props and inspect the exact JSX before copying it. The preview loads only when this section enters the viewport.

Generated JSX
<Stepper
  defaultValue={2}
  orientation="horizontal"
  aria-label="Release progress"
>
  <StepperItem
    step={1}
  >
    <StepperTrigger>
      <StepperIndicator />
      <StepperTitle>Plan</StepperTitle>
    </StepperTrigger>
    <StepperSeparator />
  </StepperItem>
  <StepperItem
    step={2}
  >
    <StepperTrigger>
      <StepperIndicator />
      <StepperTitle>Build</StepperTitle>
    </StepperTrigger>
    <StepperSeparator />
  </StepperItem>
  <StepperItem
    step={3}
  >
    <StepperTrigger>
      <StepperIndicator />
      <StepperTitle>Release</StepperTitle>
    </StepperTrigger>
  </StepperItem>
</Stepper>

API reference

Generated from the public TypeScript exports in src/ui/stepper.tsx.

View JSON

Stepper

Component
Props: Omit<React.ComponentProps<"ol">, "defaultValue"> & { value?: number defaultValue?: number onValueChange?: (step: number) => void orientation?: "horizontal" | "vertical" }
PropTypeRequiredDefaultDescription
valuenumberNo——
defaultValuenumberNo——
onValueChange(step: number) => voidNo——
orientation"horizontal" | "vertical"No"horizontal"—

StepperItem

Component
Props: React.ComponentProps<"li"> & { step: number disabled?: boolean }
PropTypeRequiredDefaultDescription
stepnumberYes——
disabledbooleanNofalse—

StepperTrigger

Component
Props: React.ComponentProps<"button">

StepperIndicator

Component
Props: React.ComponentProps<"span">

StepperTitle

Component
Props: React.ComponentProps<"span">

StepperDescription

Component
Props: React.ComponentProps<"span">

StepperSeparator

Component
Props: React.ComponentProps<"div">

Accessibility contract

Machine-readable behavior and consumer responsibilities for stepper.

View JSON
Support
Authored behavior
Pattern
step list
HTML ordered list + buttons
Keyboard interactions for stepper
KeysBehavior
Enter SpaceActivate the focused control.

Built-in semantics

  • The active item exposes aria-current=step; separators are aria-hidden.

Consumer responsibilities

  • Give every trigger descriptive text and do not rely on color alone for completed/current state.