Skip to main content

Horizontal

Steps of a process in order. It is a nav with an ordered list, so a screen reader hears “list, 4 items”; the current step has aria-current="step" and a visually hidden word says the state of every step (“Completed: Account”), so the state is never only a colour or an icon. Styles follow data-state (complete, current, upcoming, error) through group-data-[state=…], so one markup serves every state. On a phone only the circles stay and a line below names the current step.

  1. Completed: Account
  2. 2 Current step: Shipping
  3. 3 Upcoming: Payment
  4. 4 Upcoming: Review

States

Complete is a filled circle with a check, current an outlined circle with the number, upcoming a grey outline, and error a red filled circle with an exclamation mark. The connector in front of a step is filled when the step is not upcoming. Each state differs by shape and by a word for assistive technology, not by colour alone.

  1. Completed: Cart
  2. Error: Shipping
  3. 3 Current step: Payment
  4. 4 Upcoming: Review

Vertical with descriptions

For a checklist or a setup guide, where every step has a sentence. The line runs down the left and is filled up to the last complete step.

  1. Completed: Create your account Done on Nov 3.
  2. 2 Current step: Verify your email We sent a link to your inbox.
  3. 3 Upcoming: Add your first product Upload photos and set a price.
  4. 4 Upcoming: Go live Publish your store.

Wizard

A stepper that drives a form. The component only keeps the number of the current step; the circles take their data-state and aria-current from it. The panel below is a role="status" so the change of step is announced. Replace the panel with your own form and validate before step++.

  1. 1 Account
  2. 2 Shipping
  3. 3 Payment
  4. 4 Review

Options reference

The stepper is HTML and Tailwind classes. Only the wizard example uses a small Alpine object for the current step.

Part Value Description
nav aria-label text Required: names the stepper, for example “Checkout progress”.
ol and li elements One li per step, with the group/step class.
data-state complete, current, upcoming, error On the li. All the styles follow it.
aria-current="step" on the current li Tells assistive technology which step it is.
State word visually hidden A sr-only text in the step (“Completed: ”) that shows for the state of the step.
Connector absolute … h-0.5 w-full A line from the middle of this step to the middle of the previous one; steps have equal width (flex-1).
Link a in a completed step Only for steps the person may go back to.
Small screens max-sm:sr-only Labels hide on a phone, and a line below names the current step.