# Progress stepper

A connected step indicator with animated progress and clear next actions.

## Usage

Use for a short, linear task. This standalone example manages step state; connect validation and actual task content before using it for a real workflow. Pass at least one step.

Save the JSX and CSS Module in the same folder in a React project with CSS Modules support. Controlled components need parent state and change handlers.

## JSX

```jsx
"use client";
import styles from "./ProgressStepper.module.css";
import { useState } from "react";
export default function ProgressStepper({
  steps = ["Brief", "Design", "Review"],
  onComplete,
}) {
  const [step, setStep] = useState(0);
  const complete = step === steps.length;
  return (
    <div className={styles.root}>
      <ol>
        {steps.map((label, index) => (
          <li
            key={label}
            data-done={index < step}
            aria-current={index === step ? "step" : undefined}
          >
            <span>{index < step ? "✓" : index + 1}</span>
            <small>{label}</small>
          </li>
        ))}
      </ol>
      <div className={styles.track} aria-hidden="true">
        <i style={{ width: `${(step / Math.max(steps.length, 1)) * 100}%` }} />
      </div>
      <p role="status">
        {complete
          ? "You’re ready for the next chapter."
          : `Step ${step + 1}: ${steps[step]}`}
      </p>
      <div className={styles.actions}>
        <button
          type="button"
          disabled={step === 0}
          onClick={() => setStep(step - 1)}
        >
          Back
        </button>
        <button
          type="button"
          onClick={() => {
            if (complete) {
              setStep(0);
              return;
            }
            const next = step + 1;
            setStep(next);
            if (next === steps.length) onComplete?.();
          }}
        >
          {complete
            ? "Start again"
            : step === steps.length - 1
              ? "Finish"
              : "Continue"}{" "}
          <span aria-hidden="true">→</span>
        </button>
      </div>
    </div>
  );
}

```

## CSS

```css
.root {
  width: 320px;
  padding: 24px;
  border: 1px solid var(--tdp-border, #d9d1c9);
  border-radius: var(--tdp-radius, 8px);
  background: var(--tdp-surface, #fffdfa);
}
.root ol {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.root li {
  text-align: center;
  flex: 1;
}
.root li > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0 auto 9px;
  border: 1px solid var(--tdp-border, #d9d1c9);
  border-radius: 50%;
  font-size: 12px;
  transition:
    background 0.3s,
    color 0.3s,
    scale 0.3s;
}
.root li[aria-current] > span {
  border-color: var(--tdp-primary, #1f3934);
  scale: 1.08;
}
.root li[data-done="true"] > span {
  background: var(--tdp-primary, #1f3934);
  color: var(--tdp-on-primary, #fff);
}
.root small {
  font-size: 11px;
}
.track {
  height: 3px;
  background: var(--tdp-subtle, #eee8e1);
  border-radius: 4px;
  margin: 20px 0;
}
.track i {
  display: block;
  height: 100%;
  background: var(--tdp-primary, #1f3934);
  transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.root p {
  min-height: 40px;
  font-size: 13px;
  color: var(--tdp-muted, #6b625b);
}
.actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}
.actions button {
  min-height: 44px;
  border: 1px solid var(--tdp-border, #d9d1c9);
  border-radius: var(--tdp-radius, 8px);
  padding: 8px 12px;
  background: transparent;
  color: inherit;
  font-size: 12px;
}
.actions button + button {
  background: var(--tdp-primary, #1f3934);
  color: var(--tdp-on-primary, #fff);
  border-color: transparent;
}
.root {
  font-family: var(--tdp-font, "DM Sans", system-ui, sans-serif);
  color: var(--tdp-text, #302e2b);
  max-width: 100%;
  box-sizing: border-box;
}
.root * {
  box-sizing: border-box;
}
.root :is(button, input, a):focus-visible,
.root:focus-visible {
  outline: 3px solid var(--tdp-focus, #7851a9);
  outline-offset: 4px;
}
.root button {
  font: inherit;
  cursor: pointer;
}
.root button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.root button,
.root a {
  touch-action: manipulation;
}
@media (prefers-reduced-motion: reduce) {
  .root,
  .root *,
  .root::before,
  .root::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    translate: none !important;
    rotate: none !important;
    scale: none !important;
    scroll-behavior: auto !important;
  }
}

```

## Props

- steps (string[]): Nonempty list of unique step labels.
- onComplete (function): Called when the final step is finished.

## Accessibility

An ordered list describes the sequence and aria-current marks the active step. Progress changes are announced in a status region. Navigation uses native buttons.

Check accessibility again after customizing the component.

[Browse all components](/resources/components/)

Canonical: https://designproject.io/resources/components/progress-stepper/

## Keep learning

- [How to create a UI color palette, step by step](https://designproject.io/resources/guides/create-ui-color-palette/)
- [Product design glossary: 44 terms explained](https://designproject.io/resources/glossary/)
- [How to choose font pairings for a product interface](https://designproject.io/resources/guides/choose-font-pairings/)
