28 / blog / migrationJune 20268 min read

Replace GSAP ScrollTrigger with scrollAnimate

svg-scroll-draw v2 ships scrollAnimate — a replacement for the common scroll animation use cases that today reach for GSAP + ScrollTrigger. About 3.8× smaller. Zero dependencies. One function call.

  • Migration
  • ScrollTrigger
  • scrollAnimate
  • no GSAP
GSAP stack
45.3 KB
svg-scroll-draw
11.9 KB
Smaller by
3.8×
Recipes migrated
5

ScrollTrigger recipesvg-scroll-draw

  1. 01Fade + slide ingsap.to() + scrollTriggerscrollAnimate()svg-scroll-draw
  2. 02Parallax backgroundgsap.to({ y }) + scrubscrollParallax()svg-scroll-draw
  3. 03Stats countergsap.to({ val }) + onUpdatescrollCounter()svg-scroll-draw
  4. 04Text revealSplitText + gsap.from()scrollText()svg-scroll-draw/text
  5. 05Video scrubbingonUpdate → currentTimescrollVideo()svg-scroll-draw/video

Weight on the pageGzipped

gsap + ScrollTrigger45.3 KB
svg-scroll-draw11.9 KB
Fig. 1 — the migration map — each ScrollTrigger recipe in this post and the one call that replaces it; weights to one scale, measured 2026-08-14
01The cost

Why GSAP in the first place?

GSAP is the de facto choice for scroll animations because it covers everything: fade, slide, color transitions, counters, text reveals, video scrubbing. Developers install it once and use it for everything.

The cost: 45.3 KB gzipped (ScrollTrigger adds 17.6 KB on top of GSAP core's 27.7 KB) and a non-trivial API surface. It is not a licence cost any more: since 2025 every GSAP plugin, SplitText included, is free. For most projects, though, much of that weight covers use cases you never touch.

Runtime is a separate question from bytes: the GSAP vs svg-scroll-draw benchmark measures what each costs the main thread during a scroll, with the results GSAP wins left in.

02Fade + slide

The side-by-side

Here is the most common GSAP scroll pattern — fade + slide in on scroll:

BeforeGSAP + ScrollTrigger

gsap-before.js18 lines
// GSAP — 45.3 KB gzipped, needs two imports
import gsap from 'gsap';
import ScrollTrigger from 'gsap/ScrollTrigger';
gsap.registerPlugin(ScrollTrigger);

gsap.to('#hero-text', {
  opacity:    1,
  y:          0,
  duration:   0.8,
  ease:       'power2.out',
  scrollTrigger: {
    trigger:  '#hero-text',
    start:    'top 80%',
    end:      'top 40%',
    scrub:    true,
    once:     true,
  },
});

Aftersvg-scroll-draw

svg-scroll-draw-after.js12 lines
// svg-scroll-draw v2 — ~12 KB total, one import, no plugin registration
import { scrollAnimate } from 'svg-scroll-draw';

scrollAnimate('#hero-text', {
  props: {
    opacity:   [0, 1],
    transform: ['translateY(40px)', 'translateY(0px)'],
  },
  trigger: { start: 'top 80%', end: 'top 40%' },
  easing:  'ease-out',
  once:    true,
});
svg-scroll-draw11.9 KB
GSAP core27.7 KB
GSAP core + ScrollTrigger45.3 KB
Fig. 2 — All sizes minified + gzipped at level 9, measured 2026-08-14 against gsap 3.15.0, svg-scroll-draw 2.31.0 — measured, not estimated.
03Migrated

Common patterns, migrated

Parallax background

BeforeGSAP

parallax.js3 lines
// GSAP
gsap.to('#bg', { y: -120, ease: 'none',
  scrollTrigger: { trigger: '#bg', start: 'top bottom', end: 'bottom top', scrub: true } });

Aftersvg-scroll-draw

parallax.js3 lines
// svg-scroll-draw
import { scrollParallax } from 'svg-scroll-draw';
scrollParallax('#bg', { speed: 0.4 }); // speed = fraction of element height

Stats counter

BeforeGSAP

counter.js6 lines
// GSAP (needs a custom plugin or TextPlugin)
gsap.to({ val: 0 }, {
  val: 50000, duration: 2, ease: 'power1.out',
  scrollTrigger: { trigger: '#count', start: 'top 80%', once: true },
  onUpdate() { document.getElementById('count').textContent = Math.round(this.targets()[0].val); },
});

Aftersvg-scroll-draw

counter.js3 lines
// svg-scroll-draw
import { scrollCounter } from 'svg-scroll-draw';
scrollCounter('#count', { to: 50000, easing: 'ease-out', once: true });

Text reveal (SplitText)

BeforeGSAP SplitText

text.js4 lines
// GSAP SplitText — free, 3.6 KB (+ GSAP core to animate)
const split = new SplitText('#headline', { type: 'words' });
gsap.from(split.words, { opacity: 0, y: 24, stagger: 0.05, ease: 'power2.out',
  scrollTrigger: { trigger: '#headline', start: 'top 85%', once: true } });

Aftersvg-scroll-draw/text

text.js3 lines
// svg-scroll-draw/text — free, MIT
import { scrollText } from 'svg-scroll-draw/text';
scrollText('#headline', { split: 'words', stagger: 0.05, from: { opacity: 0, y: 24 }, once: true });

Video scrubbing

BeforeGSAP

video.js5 lines
// GSAP
gsap.to({}, {
  scrollTrigger: { trigger: '#section', start: 'top top', end: 'bottom top', scrub: true,
    onUpdate: self => { video.currentTime = self.progress * video.duration; } },
});

Aftersvg-scroll-draw/video

video.js3 lines
// svg-scroll-draw/video
import { scrollVideo } from 'svg-scroll-draw/video';
scrollVideo('#hero-video', { trigger: { start: 'top top', end: 'bottom top' } });
04Instance

The instance API is the same

Every function in svg-scroll-draw returns the same instance object, so programmatic control feels identical to GSAP:

instance.js8 lines
const anim = scrollAnimate('#el', { props: { opacity: [0, 1] } });

anim.pause();           // pause at current frame
anim.resume();          // resume
anim.seek(0.5);         // jump to 50%
anim.replay();          // reset and replay
anim.getProgress();     // → 0–1
anim.destroy();         // remove all listeners
05Honest guidance

When to still use GSAP

svg-scroll-draw covers the common cases. There are scenarios where GSAP is still the right tool:

  • Complex multi-element non-scroll timelines (absolute time, tweening unrelated to scroll)
  • Physics simulations and draggable interactions (Draggable plugin)
  • Advanced SVG morphing with incompatible path structures (MorphSVG plugin)
  • Canvas / WebGL animations

For everything scroll-driven — and that is the vast majority of landing page and marketing site animation — svg-scroll-draw v2 gets you there at a fraction of the bundle cost.

→Parts list

Keep reading

More from the blog