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)
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
4.0× smaller than GSAP
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.
Same animation, both libraries
Vanilla JS
BeforeGSAP DrawSVG
// 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
// 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
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
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
// 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
// stagger is a first-class option
scrollDraw('#chart', {
easing: 'ease-out',
stagger: 0.15,
once: true,
});Full feature matrix
| Feature | svg-scroll-draw | GSAP DrawSVG |
|---|---|---|
| License | MIT — fork and redistribute freely | Free to use; own terms restrict redistribution |
| Bundle size (gzipped) | ~12 KB | 47.5 KB (gsap + ScrollTrigger + DrawSVG) |
| Dependencies | Zero | 3 packages to install and register |
| Native CSS fast path | Yes — 0 JS per frame in Chrome/Edge 115+, Safari 26+, Firefox 159+ | No — JS only |
| React component | <ScrollDraw> + useScrollDraw hook | useEffect/useRef boilerplate every time |
| Vue 3 | <ScrollDraw> + useScrollDraw composable | Manual setup, no official wrapper |
| Svelte | use:scrollDraw action | Manual setup |
| Solid.js | useScrollDraw + createScrollDraw | Manual setup |
| Angular / Nuxt / Astro | First-class wrappers | Manual setup |
| stagger | Built-in option | gsap.utils.toArray() + per-element delay |
| morphTo | Built-in option | MorphSVGPlugin — free, but another package |
| CSS custom property | --scroll-draw-progress on every frame | Manual onUpdate callback |
| Sequence API | scrollDrawSequence() | Complex ScrollTrigger chaining |
| Group API | scrollDrawGroup() | Manually share trigger across multiple tweens |
| Physics easings | spring, bounce, elastic built-in + factory fns | Bounce, Elastic, CustomEase — all free, separate imports |
| Timeline API | —scrollDrawTimeline() — independent track windows | Yes — GSAP timeline is its strength |
| Complex multi-element timelines | —Scroll-draw scope only | Yes — GSAP excels here |
| Non-SVG animations | —clip reveal only | Yes — text, DOM, anything |
| SSR safe | Yes — observers skip on server | Needs manual typeof window guards |
| TypeScript | Full types included | Full types included |
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:
- 01Complex multi-element timelines Orchestrating dozens of DOM elements across a 10-second scrubbed sequence — GSAP's timeline API has no peer.
- 02Non-SVG animations Text splitting, FLIP, DOM transforms, canvas — GSAP animates anything. svg-scroll-draw only handles SVG paths.
- 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.
- 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.
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.
Step 01
Install
terminalnpm i svg-scroll-draw # remove: npm uninstall gsap (if gsap was only used for DrawSVG)Step 02
Replace the GSAP call
BeforeBefore (GSAP)
hero.jsimport 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.jsimport { scrollDraw } from 'svg-scroll-draw'; scrollDraw('#hero', { easing: 'ease-out', trigger: { start: 'top 80%', end: 'bottom 20%', }, });Step 03
Easing name map
GSAP ease svg-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.