32 / blog / comparisonMay 20266 min read

svg-scroll-draw vs GSAP DrawSVG

GSAP DrawSVG is powerful, and since 2025 it's free for everyone — so this isn't a price argument. It does still cost you 47.5 KB, three packages to register, and boilerplate in every framework. Here's a complete comparison, side-by-side code, and a migration guide.

  • Comparison
  • GSAP DrawSVG
  • ScrollTrigger
  • migration
svg-scroll-draw
~12 KB
GSAP stack
47.5 KB
Licence
MIT
GSAP licence
Free

GSAP stack47.5 KB

01gsap27.7
02ScrollTrigger17.6
03DrawSVGPlugin2.2
04registerPlugin()+ registration before the first tween—

svg-scroll-draw11.9 KB

01svg-scroll-draw11.9
Fig. 1 — one path drawn on scroll — what each side ships, to scale · measured 2026-08-14
01At a glance

The short version

svg-scroll-draw

  • ~12 KB gzipped — 4.0× smaller than GSAP
  • MIT — free for commercial use, forever
  • Zero dependencies
  • Native CSS fast path (Chrome/FF 115+)
  • First-class React, Vue, Svelte, Solid, Angular, Nuxt, Astro wrappers
  • stagger, morphTo, Sequence, Group, Timeline — all built in
  • SSR-safe out of the box

GSAP DrawSVG

  • 47.5 KB (gsap + ScrollTrigger + DrawSVG)
  • 3 packages, plugin registration boilerplate
  • JS only — no native CSS path
  • No framework wrappers — useEffect + useRef every time in React
  • Path morphing needs MorphSVGPlugin — free, but another import
  • Unmatched for complex multi-element timelines (non-SVG)
02Licensing

The real cost of GSAP DrawSVG

It is not money. GSAP is free — Webflow acquired GreenSock and released the whole toolset, DrawSVG and MorphSVG included, at no charge in 2025. If you have read an older comparison that says otherwise, including an earlier version of this post, it is out of date.

The cost is bytes and setup. To draw one path on scroll you install three packages, call gsap.registerPlugin(), and ship 47.5 KB gzipped — for an effect that is fundamentally one animated stroke-dashoffset.

The one licence difference worth knowing is narrow: svg-scroll-draw is MIT, so you can fork it, bundle it and redistribute it inside your own library. GSAP's licence is free-of-charge but has its own terms around redistribution in a competing product — read them yourself rather than take our word for it.

svg-scroll-draw
MIT · ~12 KB · zero deps
GSAP DrawSVG
Free · 47.5 KB · 3 packages
03Bundle size

4.0× smaller than GSAP

svg-scroll-draw11.9 KB
GSAP + ScrollTrigger + DrawSVG47.5 KB
Framer Motion34.3 KB
Fig. 2 — All sizes minified + gzipped at level 9, measured 2026-08-14 against gsap 3.15.0, framer-motion 13.1.0, svg-scroll-draw 2.31.0 — measured, not estimated.

GSAP stack includes gsap core (27.7 KB) + ScrollTrigger (17.6 KB) + DrawSVG plugin (2.2 KB). Where the browser supports animation-timeline: view() (Chrome and Edge 115+, Safari 26+, Firefox 159+), svg-scroll-draw also hands the simple draw case to the browser’s native CSS scroll timeline — zero per-frame JavaScript.

What that saves while the page scrolls, and where GSAP comes out ahead, is measured scenario by scenario in the GSAP vs svg-scroll-draw benchmark.

04Code comparison

Same animation, both libraries

Vanilla JS

BeforeGSAP DrawSVG

hero.js21 lines
// 3 imports, plugin registration required
import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
import { DrawSVGPlugin } from 'gsap/DrawSVGPlugin';

gsap.registerPlugin(ScrollTrigger, DrawSVGPlugin);

gsap.fromTo(
  '#logo path',
  { drawSVG: '0%' },
  {
    drawSVG: '100%',
    ease: 'power2.out',
    scrollTrigger: {
      trigger: '#logo',
      start: 'top 80%',
      end: 'top 20%',
      scrub: true,
    },
  }
);

Aftersvg-scroll-draw

hero.js7 lines
// 1 import, zero config
import { scrollDraw } from 'svg-scroll-draw';

scrollDraw('#logo', {
  easing: 'ease-out',
  trigger: { start: 'top 80%', end: 'top 20%' },
});

React

BeforeGSAP DrawSVG

Logo.tsx28 lines
import { useEffect, useRef } from 'react';
import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
import { DrawSVGPlugin } from 'gsap/DrawSVGPlugin';

gsap.registerPlugin(ScrollTrigger, DrawSVGPlugin);

function Logo() {
  const ref = useRef<SVGSVGElement>(null);

  useEffect(() => {
    const ctx = gsap.context(() => {
      gsap.fromTo('path', { drawSVG: '0%' }, {
        drawSVG: '100%',
        ease: 'power2.out',
        scrollTrigger: {
          trigger: ref.current,
          start: 'top 80%',
          end: 'top 20%',
          scrub: true,
        },
      });
    }, ref);
    return () => ctx.revert();
  }, []);

  return <svg ref={ref}>…</svg>;
}

Aftersvg-scroll-draw

Logo.tsx12 lines
import { ScrollDraw } from 'svg-scroll-draw/react';

function Logo() {
  return (
    <ScrollDraw
      easing="ease-out"
      trigger={{ start: 'top 80%', end: 'top 20%' }}
    >
      <svg>…</svg>
    </ScrollDraw>
  );
}

With stagger

BeforeGSAP DrawSVG

chart.js16 lines
// Must use gsap.utils.toArray + manual delay
const paths = gsap.utils.toArray('#chart path');
paths.forEach((path, i) => {
  gsap.fromTo(path,
    { drawSVG: '0%' },
    {
      drawSVG: '100%',
      delay: i * 0.15,
      scrollTrigger: {
        trigger: '#chart',
        start: 'top 80%',
        scrub: true,
      },
    }
  );
});

Aftersvg-scroll-draw

chart.js6 lines
// stagger is a first-class option
scrollDraw('#chart', {
  easing: 'ease-out',
  stagger: 0.15,
  once: true,
});
05Feature comparison

Full feature matrix

Featuresvg-scroll-drawGSAP DrawSVG
LicenseMIT — fork and redistribute freelyFree to use; own terms restrict redistribution
Bundle size (gzipped)~12 KB47.5 KB (gsap + ScrollTrigger + DrawSVG)
DependenciesZero3 packages to install and register
Native CSS fast pathYes — 0 JS per frame in Chrome/Edge 115+, Safari 26+, Firefox 159+No — JS only
React component<ScrollDraw> + useScrollDraw hookuseEffect/useRef boilerplate every time
Vue 3<ScrollDraw> + useScrollDraw composableManual setup, no official wrapper
Svelteuse:scrollDraw actionManual setup
Solid.jsuseScrollDraw + createScrollDrawManual setup
Angular / Nuxt / AstroFirst-class wrappersManual setup
staggerBuilt-in optiongsap.utils.toArray() + per-element delay
morphToBuilt-in optionMorphSVGPlugin — free, but another package
CSS custom property--scroll-draw-progress on every frameManual onUpdate callback
Sequence APIscrollDrawSequence()Complex ScrollTrigger chaining
Group APIscrollDrawGroup()Manually share trigger across multiple tweens
Physics easingsspring, bounce, elastic built-in + factory fnsBounce, Elastic, CustomEase — all free, separate imports
Timeline API—scrollDrawTimeline() — independent track windowsYes — GSAP timeline is its strength
Complex multi-element timelines—Scroll-draw scope onlyYes — GSAP excels here
Non-SVG animations—clip reveal onlyYes — text, DOM, anything
SSR safeYes — observers skip on serverNeeds manual typeof window guards
TypeScriptFull types includedFull types included
06Honest guidance

When GSAP still makes sense

svg-scroll-draw is purpose-built for one thing: animating SVG paths as you scroll. If your project goes beyond that, GSAP may be the right tool:

  1. 01Complex multi-element timelines Orchestrating dozens of DOM elements across a 10-second scrubbed sequence — GSAP's timeline API has no peer.
  2. 02Non-SVG animations Text splitting, FLIP, DOM transforms, canvas — GSAP animates anything. svg-scroll-draw only handles SVG paths.
  3. 03Physics easings (CustomEase) svg-scroll-draw ships spring, bounce, and elastic. But GSAP's CustomEase and the depth of its easing ecosystem still win for highly tailored curves.
  4. 04Already in your bundle If you're already paying the GSAP bundle cost for other animations, DrawSVG adds marginal bytes and your team already knows the API.
07Migration guide

Switch in under 5 minutes

For SVG path drawing specifically, the migration is almost mechanical. The concepts map directly.

Before you switch, paste the SVG into the SVG path viewer: it lists each path’s length and anything that would stop it drawing, such as a fill or a missing stroke.

  1. Step 01

    Install

    terminal2 lines
    npm i svg-scroll-draw
    # remove: npm uninstall gsap (if gsap was only used for DrawSVG)
  2. Step 02

    Replace the GSAP call

    BeforeBefore (GSAP)

    hero.js16 lines
    import gsap from 'gsap';
    import { ScrollTrigger } from 'gsap/ScrollTrigger';
    import { DrawSVGPlugin } from 'gsap/DrawSVGPlugin';
    
    gsap.registerPlugin(ScrollTrigger, DrawSVGPlugin);
    
    gsap.fromTo('#hero path', { drawSVG: '0%' }, {
      drawSVG: '100%',
      ease: 'power2.out',
      scrollTrigger: {
        trigger: '#hero',
        start: 'top 80%',
        end: 'bottom 20%',
        scrub: true,
      },
    });

    AfterAfter (svg-scroll-draw)

    hero.js9 lines
    import { scrollDraw } from 'svg-scroll-draw';
    
    scrollDraw('#hero', {
      easing: 'ease-out',
      trigger: {
        start: 'top 80%',
        end: 'bottom 20%',
      },
    });
  3. Step 03

    Easing name map

    GSAP easesvg-scroll-draw easing
    power2.out / power3.out"ease-out"
    power2.in"ease-in"
    power2.inOut"ease-in-out"
    linear"linear"
    elastic.out"spring" or createSpring({ tension, friction })
    none"linear"

— / next

Ready to make the switch?

One install, no membership, and it works in every framework

Star on GitHubFound this useful? A star helps others find it.

→Parts list

Keep reading

01ExampleLogo reveal on scrollDraw an SVG logo stroke-by-stroke as the user scrolls, then flood it with brand colour on completion. Copy-paste React code, no GSAP or plugins.02ExampleSignature handwriting animationMake a signature write itself as the page scrolls — the classic handwriting effect in a few lines of SVG and one function call. No GSAP, no canvas.03ExampleLine chart that draws on scrollAnimate a line chart as it scrolls into view: the grid and axes first, then two years of data tracing in. Copy-paste code, no chart library.04ExampleFlowchart that draws on scrollDraw a flowchart step by step as the reader scrolls: boxes, then connectors, in sequence. Keeps the diagram readable before it animates. Copy-paste code.05ExampleArchitecture diagram connectionsDraw the wires between services as the reader scrolls an architecture diagram. Boxes stay readable; only the connections animate. Copy-paste code.06ExampleMap route tracing on scrollTrace a delivery route across a map as the page scrolls — the journey-line effect used on logistics and travel sites. No mapping library required.07ToolSVG path viewerPaste an SVG: every path’s length and commands, what stops it drawing, and the draw code.08ToolSVG line drawing generatorPaste any SVG and get one self-contained file that draws itself line by line with CSS and no JavaScript, or the scroll version.09PageThe full GSAP comparisonBeyond DrawSVG — the whole feature matrix, measured.

More from the blog