00 / svg-scroll-drawMIT · open source

SVG line drawing on scroll, done right

Correct path lengths, stagger and morph, drawn on the browser’s own scroll timeline where it can be and by a frame loop where it can’t. 11.9 KB gzipped, against 47.5 KB for GSAP, ScrollTrigger and DrawSVG.

Get started

Switch from AOS, ScrollReveal or vivus in one line29 free tools

Gzipped
11.9 KB
Dependencies
0
Unit tests
1077
Browser tests
359 ×3
SVG-SCROLL-DRAWMIT
01 / what people draw

If it’s a line, it can follow the scroll

Signatures, maps, charts, product sketches, logos, diagrams — each one below is drawn by the library as you reach it.

Signatures

Hand-signed sign-offs and hero lettering.

scrollDraw('#signature')

Route maps

Journeys that unfold as the reader scrolls.

scrollDraw('#route', { once: true })

Charts

Lines that plot themselves on arrival.

scrollDraw('#chart', { stagger: 0.1 })

Product sketches

Blueprints that assemble, part by part.

scrollDraw('#sketch', { stagger: 0.04 })

Logo reveals

A mark that inks itself in, once.

scrollDraw('#logo', { autoplay: true })

Diagrams

Flows that explain themselves in order.

scrollDraw('#flow', { stagger: 0.08 })

02 / scrollDraw, scrubbed

A watchmaker’s drawing, inked by your scroll

  1. 01Every path measured once
  2. 02Staggered in the order you wrote them
  3. 03Eased stroke by stroke
  4. 04No JavaScript per frame where the browser can
scrollDraw('#caliber', {stagger: 0.009, speed: 8, easing: 'ease-in-out',})

03 / annotations, drawn in order

Notes in the margin, drawn as you read

svg-scroll-draw is 10 KB gzipped with zero dependencies. It draws on the browser’s native scroll timeline where one exists and falls back to a frame loop where it doesn’t — and it is MIT, so it is Yours.

scrollDraw('#proof', {stagger: 0.004, speed: 50})
504030201001020304050GSAP CORE27.7 KBSCROLLTRIGGER17.6 KBDRAWSVG2.2 KBGSAP3.15.0 · 47.5 KB11.9 KBSVG-SCROLL-DRAW2.31.0 · 11.9 KB

04 / against the incumbent

The same drawing in a fifth of the bytes

GSAP 3.15.0 · ScrollTrigger · DrawSVG17 lines · 47.5 KB
import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
import { DrawSVGPlugin } from 'gsap/DrawSVGPlugin';

gsap.registerPlugin(ScrollTrigger, DrawSVGPlugin);

gsap.from('#logo path', {
  drawSVG: 0,
  stagger: 0.1,
  ease: 'power1.out',
  scrollTrigger: {
    trigger: '#logo',
    start: 'top 80%',
    end: 'top 30%',
    scrub: true,
  },
});
svg-scroll-draw 2.31.07 lines · 11.9 KB
import { scrollDraw } from 'svg-scroll-draw';

scrollDraw('#logo', {
  stagger: 0.1,
  easing: 'ease-out',
  trigger: { start: 'top 80%', end: 'top 30%' },
});
Reading
Δ 0.0 KB
Tilt · 0.2°/KB
0.00°

Minified and gzipped at level 9, measured 2026-08-14. GSAP has been free since 2025 and does far more than scroll; for the scroll effects here, this is the difference you ship.

05 / the toolkit

Eight instruments, one instance shape

destroy, replay, pause, resume, seek, getProgress — learn one, know them all

const it = scrollText('h1', { split: 'chars' })it.destroy()it.replay()it.pause()it.resume()it.seek(0.5)it.getProgress()

06 / proof

Tested in real browsers, not just in theory

const opts = {trigger: { start: 'top 85%', end: 'center 45%' },stagger: 0.014, speed: 7, onProgress: readNeedles,}scrollDraw('#dials', opts)scrollDraw('#readings', opts)
0255075100125150175200225250275300325350359CHROMIUMTESTS
0255075100125150175200225250275300325350359FIREFOXTESTS
0255075100125150175200225250275300325350359WEBKITTESTS
SRC/__TESTS__901234567890190123456789019012345678901901234567890190123456789019012345678901
024681012KB · GZIP
RUNTIMEDEPENDENCIES

07 / your stack

Written the way your framework writes

A component in React and Vue, an action in Svelte, a hook in Solid, a custom element for plain HTML. SSR-safe.

Hero.tsxsvg-scroll-draw/react
'use client';import { ScrollDraw, ScrollText } from 'svg-scroll-draw/react';export function Hero() {  return (    <>      <ScrollText as="h1" split="words" stagger={0.05}>        Every word arrives on scroll      </ScrollText>      <ScrollDraw easing="ease-out">        <svg viewBox="0 0 200 80">{/* paths */}</svg>      </ScrollDraw>    </>  );}
npm i svg-scroll-drawnet J1 · J9

08 / switching

Already on AOS? Change one import

Your markup and your calls stay exactly as they are. Only the import changes — and the page does the same thing, in fewer bytes.

Beforeimport AOS from 'aos'
your-site.comdata-aos="fade-up"data-aos="fade-up"data-aos="fade-up"
6.7 KBAOS 2.3.4 · gzip
Afterimport AOS from 'svg-scroll-draw/aos'
your-site.comdata-aos="fade-up"data-aos="fade-up"data-aos="fade-up"
3.2 KBdrop-in · gzip

AOS.init() keeps working. 6.7 KB → 3.2 KB, matched against the original in Chromium, Firefox and WebKit.

AOS in Next.js guide

09 / in the open

Built in the open, counted live

live · refreshed hourly · checked Nov 30, 12:36 UTC

14GitHub starsapi.github.com
0Forksapi.github.com
4Open issuesapi.github.com
3d agoLast commitapi.github.com
293npm / weekapi.npmjs.org
7,709npm / monthapi.npmjs.org
12.8knpm / all timeapi.npmjs.org
npm downloads · 12,771 total · peak 1182 on Nov 14
11820May 25, 2026Nov 29peak · 1182 on Nov 14

★ / one more plate

A star, by compass and scroll

  1. 01Circle about O
  2. 02Diameter, and the radius OA
  3. 03Bisect OB at M
  4. 04Swing MA down to N
  5. 05Step AN round the circle
  6. 06Join every second point
  7. 07Ink the outline. It’s yours.
Star on GitHub

Notes

  1. 1Zero runtime dependencies.
  2. 2SSR-safe: no DOM on the server.
  3. 3Honours reduced motion.
  4. 4Do not scale. It scales itself.

10 / your turn

One install, one call, and the page follows the scroll

Read the docsStar on GitHub