# Progress Stepper

> A numbered step indicator for checkouts and wizards, with done, current and upcoming states.

- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: steps, wizard, checkout, progress, counter
- Live preview: https://copy-css.com/snippets/stepper
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<ol class="stepper">
  <li class="done">Cart</li>
  <li aria-current="step">Shipping</li>
  <li>Payment</li>
</ol>
```

## CSS

```css
.stepper {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  font: 600 13px/1 system-ui, sans-serif;
}

.stepper li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 90px;
  color: #94a3b8;
  counter-increment: step;
}

/* Number bubble */
.stepper li::before {
  content: counter(step);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
}

/* Connector line to the previous step */
.stepper li + li::after {
  content: "";
  position: absolute;
  top: 15px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: #e2e8f0;
}

.stepper .done,
.stepper [aria-current] {
  color: #0f172a;
}

.stepper .done::before {
  content: "\2713";
  border-color: #10b981;
  background: #10b981;
  color: #fff;
}

.stepper [aria-current]::before {
  border-color: #10b981;
  color: #10b981;
}

.stepper [aria-current]::after {
  background: #10b981;
}
```

## Notes

- This CSS Progress Stepper is 63 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses CSS Grid and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
