Animate one after another

Strict ordering is what separates a sequence from a stagger: step two must not begin until step one has genuinely reached 100%, however fast or slow the reader scrolls. Hand-tuned delays cannot promise that, because the timing depends on scroll speed. scrollDrawSequence chains on completion instead, so the order holds at any pace.

14scrollDrawSequence · onComplete

The code

A CI/CD product's home page. The pipeline's stages — commit, build, test, deploy — each draw only when the one before has finished, and onComplete marks every stage green as it lands.

Hero.tsx15 lines
import { scrollDrawSequence } from 'svg-scroll-draw/group';

const stages = document.querySelectorAll('.stage-icon');
let done = 0;

scrollDrawSequence([...stages], {
  trigger: { start: 'top 80%', end: 'top 30%' },
  easing:  'ease-out',
  speed:   1.3,
  // fires as each stage finishes drawing
  onComplete: () => {
    stages[done]?.closest('li').classList.add('is-done');
    done++;
  },
});
Shipyard, ci/cd that runs every stage in order: the first screen of its demo site

CI/CD that runs every stage in order

Shipyard

Live site

Related examples

MIT licensed, zero runtime dependencies. Every API is a separate entry point, so you only ship what you import. Full API reference →