---
title: "Stepper"
description: "The steps of a fixed flow, such as a checkout or a setup wizard. It shows where you are, across or down, with numbers or dots."
url: https://gelatinui.com/components/stepper
markdown_url: https://gelatinui.com/components/stepper.md
access: free
install: "npx shadcn@latest add @gelatin-ui/stepper"
registry_item: https://gelatinui.com/r/stepper.json
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Stepper

> The steps of a fixed flow, such as a checkout or a setup wizard. It shows where you are, across or down, with numbers or dots.

Page: https://gelatinui.com/components/stepper

## When to use it

Best for: A flow with a known number of steps in a fixed order: a checkout or a setup wizard.

- Use it for a flow with a known number of steps in a fixed order.
- Keep it linear (the default) when a step needs the one before it. Use `nonLinear` when people can jump to any step.
- Use `readOnly` for progress that people cannot change, such as an order status.
- Check a step in `onValueChange` and call `eventDetails.cancel()` to keep people on it.

## When not to use it

- For a task that loads with no steps, use a [Spinner](https://gelatinui.com/components/spinner.md).

## Notes for agents

- It is linear by default: set `nonLinear` to let people jump to any step.
- To keep people on a step, call `eventDetails.cancel()` in `onValueChange`.

## Anatomy

```text
Stepper
├─ StepperList (0..n)
├─ StepperItem (0..n)
├─ StepperTrigger (0..n)
├─ StepperIndicator (0..n)
├─ StepperTitle (0..n)
├─ StepperDescription (0..n)
├─ StepperSeparator (0..n)
├─ StepperContent (0..n)
├─ StepperCount (0..n)
├─ StepperPrevious (0..n)
└─ StepperNext (0..n)
```

## API reference

### Stepper

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `orientation` | `"horizontal" \| "vertical"` | "horizontal" |  |
| `size` | `"default" \| "sm"` | "default" |  |
| `variant` | `"dot" \| "number"` | "number" |  |
| `value` | `number` |  | The current step, a 0-based index (controlled). |
| `defaultValue` | `number` | 0 | The first step when the Stepper is not controlled. Default 0. |
| `onValueChange` | `function` |  | Runs before a step change, with the new index and the Base UI event details. Validate here: `eventDetails.cancel` keeps the step (and the focus) where they are. In a controlled Stepper, set `value` here. |
| `nonLinear` | `boolean` | false | Lets every step be a button, so people can jump ahead. Off by default: a step after the furthest one reached is locked, so a checkout cannot skip a required step. |
| `focusOnChange` | `boolean` | true | Moves focus to the new `StepperContent` after a change by a trigger, Next, or Previous (default `true`). Turn it off only when the app moves focus itself. |
| `readOnly` | `boolean` | false | Read-only progress (an order, a deploy): each `StepperTrigger` renders a plain `<div>` with the same layout, so there are no buttons, no hover, and no tab stops, and the current item has `aria-current="step"`. |
| `locale` | `string` |  | A BCP 47 locale for the step numbers (`"ar-EG"` gives Arabic-Indic digits). Default: the `DisplayLocaleProvider` locale, else `"en-US"`. |
| `labels` | `Partial<StepperLabels>` |  | The words of the step place ("Step 2 of 4"). |

### StepperList

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### StepperItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `status` | `StepperStatus` |  | Where the step is. Derived from the value when not set: before it `done`, at it `current`, after it `upcoming`. Set `error` after a failed check (on the current step it keeps the current ring, in `destructive`), or `done` for a step that is done out of order. |
| `disabled` | `boolean` | false | A step that does not apply: 50%, a disabled button, and Next and Previous skip it. |
| `busy` | `boolean` | false | The step waits for the app (an async check): the mark shows a spinner, the content is `aria-busy`. |

### StepperTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

### StepperIndicator

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### StepperTitle

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### StepperDescription

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### StepperSeparator

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### StepperContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `index` | `number` |  | The step of this content. Default: the step of the `StepperItem` it sits in (vertical). |
| `keepMounted` | `boolean` | false | Keeps the content in the DOM (`hidden`) when its step is not current, so form input survives. |

### StepperCount

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### StepperPrevious

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` |  |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "destructive-outline" \| "ghost" \| "link" \| "media" \| "outline" \| "secondary"` | "outline" |  |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

### StepperNext

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` |  |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "destructive-outline" \| "ghost" \| "link" \| "media" \| "outline" \| "secondary"` |  |  |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |
| `keepOnLast` | `boolean` | false | Keeps the button (disabled) on the last step. By default it renders nothing there, so the app's submit Button takes its place and no dead button sits next to a live one. |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| Stepper | `stepper` | `data-disabled`, `data-fold`, `data-last`, `data-pressable`, `data-settled`, `data-shown-folded`, `data-status`, `data-title-hidden` | `--radius`, `--stepper-item-min` | `hit-area`, `motion-timing`, `status-colors` |
| StepperList | `stepper-list` | `data-fold` | `--stepper-item-min`, `--stepper-progress` |  |
| StepperItem | `stepper-item` |  |  |  |
| StepperTrigger | `stepper-trigger` |  |  |  |
| StepperIndicator | `stepper-indicator` | `data-pressable` |  |  |
| StepperTitle | `stepper-title` |  |  |  |
| StepperDescription | `stepper-description` |  |  |  |
| StepperSeparator | `stepper-separator` |  |  |  |
| StepperContent | `stepper-content` |  |  |  |
| StepperCount | `stepper-count` |  |  |  |
| StepperPrevious | `stepper-previous` |  |  |  |
| StepperNext | `stepper-next` |  |  |  |

## Usage

The value is a 0-based step index. Put each `StepperItem` straight in `StepperList`, and check a step in `onValueChange` (call `eventDetails.cancel()` to stay).

```tsx title="checkout-steps.tsx"
import {
  Stepper, StepperContent, StepperIndicator, StepperItem, StepperList,
  StepperNext, StepperSeparator, StepperTitle, StepperTrigger,
} from "@/components/ui/stepper";

const STEPS = ["Account", "Shipping", "Payment"];

export function CheckoutSteps() {
  return (
    <Stepper defaultValue={0}>
      <StepperList>
        {STEPS.map((title, index) => (
          <StepperItem key={title}>
            <StepperTrigger>
              <StepperIndicator />
              <StepperTitle>{title}</StepperTitle>
            </StepperTrigger>
            {index < STEPS.length - 1 && <StepperSeparator />}
          </StepperItem>
        ))}
      </StepperList>
      {STEPS.map((title, index) => (
        <StepperContent key={title} index={index}>The {title} fields go here.</StepperContent>
      ))}
      <StepperNext />
    </Stepper>
  );
}
```

## Compose

Build it with:

- [Form](https://gelatinui.com/components/form.md): Owns the submit and the errors.
- [Field](https://gelatinui.com/components/field.md): Names each control and shows its error text.
- [Input](https://gelatinui.com/components/input.md): Takes short text.
- [Textarea](https://gelatinui.com/components/textarea.md): Takes long text.
- [Dialog](https://gelatinui.com/components/dialog.md): Holds a short form over the page.
- [Button](https://gelatinui.com/components/button.md): Submits or moves to the next step.
- [Alert](https://gelatinui.com/components/alert.md): Shows an error of the whole form.

Rules:

- Touch targets (`touch-targets`): Give every control a hit area of at least 44 px on touch screens, even when it looks smaller.
- Name every control (`label-every-control`): Give every field a visible `Label` (or a `Field`), and every icon button a `Tooltip` or an `aria-label`.
- Labels real apps use (`real-labels`): Write the button and menu labels that real apps use ("Create API key", "Invite members"), with no "…" at the end.
- No layout jump (`no-layout-jump`): When a state change adds, removes, or resizes content, reserve its space or animate its size, so nothing below it jumps.

Patterns: `gelatin://patterns/form-flow`

## Add it

```bash
npx shadcn@latest add @gelatin-ui/stepper
```

It adds 47 registry items: 43 files, 7483 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@phosphor-icons/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Button](https://gelatinui.com/components/button.md)
- [Dot](https://gelatinui.com/components/dot.md)
- [Spinner](https://gelatinui.com/components/spinner.md)
- [Tooltip](https://gelatinui.com/components/tooltip.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Form](https://gelatinui.com/components/form.md)
- [Button](https://gelatinui.com/components/button.md)
- [Progress](https://gelatinui.com/components/progress.md)
- [Tabs](https://gelatinui.com/components/tabs.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Moves to the next step that you can go to. Locked and disabled steps are skipped. |
| Enter | Goes to the focused step. |
| Space | Goes to the focused step. |

## Accessibility

The steps are an `<ol>`, so a screen reader says "list, 3 items". A step that you can go to is a Base UI `Button`. The current step has `aria-current="step"`. There are no arrow keys: each step is one tab stop.

In a linear flow, a step after the furthest one reached is a disabled button, so Tab skips it. The mark is `aria-hidden`. When the list folds or uses dots, a hidden title still names its button (`aria-labelledby`).

`StepperDescription` is the `aria-describedby` of its trigger, so the name stays short. `StepperContent` is a `<section>` named by the step title, with `tabIndex={-1}`. After a change it takes focus, so a screen reader reads the new step. A loading step sets `aria-busy` on its content.

Each trigger has a 44px target on touch (`hit-area`). With `readOnly`, the triggers are plain `<div>` elements with no tab stops. With `variant="dot"`, the title is hidden from view and shows in a Tooltip.

## Motion

| Part | Motion |
| --- | --- |
| Line fill | indicator · 200ms · ease-panel (0.2, 0.4, 0.2, 1) |
| New mark and content | fade · 150ms · ease-out (0, 0, 0.2, 1) |
| Vertical content | panel · 260ms · ease-panel (0.2, 0.4, 0.2, 1) |
