Flowchart that draws on scroll
A diagram that assembles itself as you scroll is the clearest way to explain a multi-step process, because the reader meets one step at a time instead of a finished wall of boxes. The trick that makes it work is what stays still: fills, labels and icons are static, so the chart is legible even before it animates and for anyone who never scrolls. Only the borders and arrows are on the timeline.
The code
A homeware shop's order confirmation. The check draws as the page opens, then the delivery journey draws in order — each station, then the road on to the next — up to where the parcel is now, with the stretch still to come left dashed; the products ink in as their cards arrive.
<ScrollDraw
selector=".go" stagger={0.32}
autoplay duration={700} delay={900}
easing="ease-in-out" once
>
<svg viewBox="0 0 1000 220">
{stations.map((s, i) => (
<g key={s.k}>
<g transform={`translate(${s.x} ${s.y})`}>
<circle r="32" />
{s.icon.map((d) => <path className={s.reached ? 'go' : 'idle'} d={d} />)}
</g>
{/* DOM order is drawing order: the station, then the road on */}
{next(i) && (
<path className={next(i).reached ? 'go road' : 'road-ahead'} d={road(s, next(i))} />
)}
</g>
))}
</svg>
</ScrollDraw>
A homeware shop’s order confirmation
Hearth & Field
Related examples
Make your own in the SVG shape to path converter: set it up, watch it run, copy the code.
MIT licensed, zero runtime dependencies. Every API is a separate entry point, so you only ship what you import. Full API reference →