Step Progress Indicator
A row of numbered dots joined by a line: two classes in the HTML say where things stand, and the dot that becomes the current step beats once.
Updated
This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Data has 28 effects, including 1 free. Explore the category →
3 usage examples



How it works
An ordered list ol.spi-steps, one li.spi-step per step, a number inside span.spi-dot. The state comes from no computation: you add spi-done to the steps already passed and spi-current to the one you are on. The former turn green, the latter indigo, the rest stay pale.
The line joining two dots belongs to the right-hand dot (it is its ::before). It turns green as soon as that dot is passed or current; dot colours fade over 0.3 s, the line colour switches sharply.
The only motion: the current dot grows by 10% and comes back, in half a second. It happens when the indicator comes on screen, and again each time spi-current is put on another dot. The script provided is a dozen lines long: it waits until half of the block is visible, then adds the spi-on class that allows the beat.
The row tightens by itself. Each line is at most --spi-line-max long and shrinks down to 12 px when room is short; the dots keep their size. There is no caption under the numbers: the indicator is meant to stay small.
Accessibility
- Reading: an ordered list named by
aria-label; Chromium exposes its items as “1 (completed)”, “2 (completed)”, “3 (in progress)”, “4”. The words in brackets arespan.spi-srelements written in the HTML, invisible on screen. - Yours to handle when the step changes: move the two classes, but also
aria-current="step"and those mentions. The code does not update them. - Animations limited by the user: no beat and no fade, colours switch at once.
- Not a menu: the dots are neither links nor buttons. To go back to a step on click, wrap the number in a real link or button, with a visible focus.
- Green and indigo look alike to some colour-blind people: position in the row and the beat help, but spell the step out in words nearby.
Browser compatibility
A flex row, custom properties, @keyframes; IntersectionObserver to wait for the indicator to appear. In Chromium 149, Firefox 151 and WebKit 26.5: the current dot reaches scale 1.10 at 250 ms and is back to 1 at 600 ms; moving spi-current from the 3rd to the 4th dot makes the 4th beat without touching a second copy of the indicator; 7 steps fit in 390 px with 40 px dots.
Without JavaScript the state displays correctly, only the beat is missing. Without IntersectionObserver the beat happens on load. With ten steps the row overflows a 390 px screen as long as dots are 40 px: set --spi-dot-size to 24 px.
The code
HTML structure to paste into your page (the CSS + JS come with your purchase):
<div class="fx-0238-root">
<ol class="spi-steps" aria-label="Progress">
<li class="spi-step spi-done"><span class="spi-dot">1</span><span class="spi-sr"> (completed)</span></li>
<li class="spi-step spi-done"><span class="spi-dot">2</span><span class="spi-sr"> (completed)</span></li>
<li class="spi-step spi-current" aria-current="step"><span class="spi-dot">3</span><span class="spi-sr"> (in progress)</span></li>
<li class="spi-step"><span class="spi-dot">4</span></li>
</ol>
</div>
One-time payment, no subscription — the code is yours forever
Customize
Options passed to the API or data-* attributes:
| Option / property | Default | Effect |
|---|---|---|
spi-done, spi-current on the li (HTML) |
steps 1 and 2 passed, 3 current | The state. No class: a step to come. Without spi-current, nothing beats (journey finished). |
Number of li (HTML) |
4 | One dot per item; what goes in .spi-dot is up to you (digit, letter, tick). |
--spi-active, --spi-done, --spi-idle (CSS) |
#6366f1, #10b981, 20% indigo | Background of the current dot, of passed dots (and travelled lines), of dots and lines to come. |
--spi-text (CSS) |
#a1a1aa | Number colour of the steps to come; the other numbers are white. |
--spi-dot-size (CSS) |
40px | Dot diameter. The number size does not follow: set font-size on the root (0 to hide it). |
--spi-line-max (CSS) |
60px | Length of a line when room is not short. |
--spi-bg, --spi-min-height (CSS) |
#0a0a0f, 300px | Background and minimum height of the block around the row; transparent and 0 inside a bar or a table row. |
FAQ
data-current, which a script turns into classes. Here it is the other way round: no caption, no animated line, and the state is written straight into the HTML. Choose this one when the page leaves the server with the step already known, or when space is tight; the other when you want a captioned journey that animates end to end.spi-current and aria-current, add spi-done, write “(completed)” in its .spi-sr. On the new one: add spi-current, aria-current="step" and “(in progress)”. The beat starts by itself, with no function to call.