Platform
VaultVault
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
ButtonsPart of ProButtons
IconsPart of ProIcons
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
SavedPart of ProSaved
Support
DocumentationDocumentation
MCP serverMCP server
SettingsSettings
VaultScrollSelf-Drawing Route
Dither Trail CursorBrowse all 182WebGL Card Carousel
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
Sign inSign in

Start free. The code for 15 components, no card needed.

Get 15 free

Self-Drawing Route

This one is locked. Become a member to open the code for it and the rest of the Vault.

See plansTry the 15 free ones

What you'll need.

Install

  • gsap
  • ScrollTrigger
  • DrawSVGPlugin

Setup

npm i gsapregisterPlugin(ScrollTrigger, DrawSVGPlugin)

More like this

  • Card
  • Line drawing
  • ScrollTrigger
  • SVG

Features.

  • A route drawn as a single SVG path draws itself in over a picture card with DrawSVGPlugin
  • A faint ghost copy of the route sits underneath, so you can see where the line is heading
  • Plays once, the moment the route enters the viewport (3s, power3.inOut), or follows the scroll both ways in scrub mode
  • Split layout: a title beside a 3:4 card
  • Stacks into one column below 992px
  • Draw time, ghost opacity and scrub mode are all attributes
  • Respects prefers-reduced-motion: the route is shown fully drawn

How to get it right.

Draw your own route

Any single <path> works. Draw it in a 487 × 383 artboard (the SVG's viewBox), copy the d value into the data-drp-route path, and keep fill="none" on the SVG. Open paths draw from their first point; closed loops come back to where they started.

Pick a picture with room for the line

The route is white at full strength over a picture shown at 80% opacity. Darker, quieter pictures let it read best.

Choose play-once or scrub

Play-once suits a reveal you only need to see once. data-au-scrub="true" ties the line to the scroll: it starts as the route's SVG box enters at the bottom, finishes when that box's centre reaches the middle of the screen, and undraws as you scroll back up.

Copy, button and stats are optional

It ships with a title and the card. For copy or a button, add <p class="drp_text"> or <a class="drp_button"> after the title (text and buttonLabel in React). For stats, add a <dl class="drp_stats"> of up to three .drp_stat items in the card (stats in React): they sit side by side on a fade at the foot of the card, and short values (a time, a distance, a count) fit on one line even on phones.

Variations.

  • Slow reveal — data-au-duration="5" for a longer, calmer draw
  • No guide — data-au-ghost="0" so the line appears out of nothing
  • Scrubbed — data-au-scrub="true" to draw with the scroll
  • Accent route — set --drp-route: #eb5e28 on the section for an orange line

Where it fits.

  • Travel and outdoor — a trail, a ride or a tour over a photo of the place
  • Event or venue pages — the way from the station to the door
  • Delivery and logistics — a journey from warehouse to doorstep
  • Case studies — a process line drawn over a project shot

Frequently asked.

Yes. Replace the d of the data-drp-route path, and change the SVG's viewBox if your artboard isn't 487 × 383. The script measures the path's length itself.

The script draws the one path marked data-drp-route in each section. For several lines, use several sections, or join the lines into a single path.

Play-once mode uses once: true, so scrolling back up leaves the route drawn. Turn on data-au-scrub="true" if you want it to follow the scroll both ways.

Yes. Override --drp-bg, --drp-fg, --drp-muted, --drp-route and the --drp-brand set on the section.

Yes. Load gsap, ScrollTrigger and DrawSVGPlugin before the script. All three are free.

Related components.

NewPro

Arc Collage Hero

Scroll

Pro

Rising Card on Scroll

Scroll

Pro

Outline Paint Reveal

Scroll