01.24 · Scroll-Based

SVG Line Draw on Scroll

A line draws itself along a route as you scroll. Best for timelines.

Scroll it

Scroll inside the box, or press Play and it scrolls for you.

— end of route —

Try it

Change a setting, then scroll again or press Play.

Feel

Even keeps the tip with your scroll; Smooth runs ahead.

Labeled points pop in as the line reaches them.

More optionsFewer options

Line finishes

Early leaves the whole route on show for a while.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add a scroll-drawn route to [your timeline, journey or process steps]. Draw a long winding path down the page with a faint dashed copy underneath, and reveal the solid line in step with the scroll so its tip travels down with the visitor. Measure the path's length once and reveal it by sliding a single dash that is exactly as long as the path. When the settings include them, place labeled stops along the path and pop each one in as the line reaches it; scrolling back up erases the line and hides them again. If the visitor has reduced motion turned on, show each stop without the pop. Match the settings listed below.

Replace the words in brackets with your own element. Your settings are added at the end.

Free and open source. If this helped, a star on GitHub helps other people find it.

Star on GitHub

What it is

The full explanation is in README.md.

Good for

  • Timelines
  • Journey maps
  • Process steps
  • Delivery tracking

Avoid on

  • Short pages