v2 · scrollAnimate · staggered

Animate any CSS property on scroll

scrollDraw handles SVG paths; scrollAnimate handles everything else — any CSS property, interpolated from scroll position, including multi-function transform strings and hex or rgb colours. This example gives each part of a pricing card its own trigger offset, which is what stops a staggered reveal reading like a single block sliding in.

The code

A pricing card where every element — badge, plan name, price, feature list, CTA — reveals on scroll with staggered scrollAnimate calls. Each element has its own trigger offset for a natural cascade.

Hero.tsx
import { scrollAnimate } from 'svg-scroll-draw';

// Each element gets its own trigger offset → natural cascade
scrollAnimate(badgeEl, {
  props: { opacity: [0, 1], transform: ['translateY(16px)', 'translateY(0)'] },
  trigger: { start: 'top 85%', end: 'top 45%' },
  easing: 'ease-out', once: true,
});

scrollAnimate(priceEl, {
  props: { opacity: [0, 1], transform: ['translateY(24px)', 'translateY(0)'] },
  trigger: { start: 'top 80%', end: 'top 40%' }, // starts 5% later
  easing: 'ease-out', once: true,
});

scrollAnimate(ctaEl, {
  props: { opacity: [0, 1], transform: ['translateY(12px)', 'translateY(0)'] },
  trigger: { start: 'top 74%', end: 'top 34%' }, // last to reveal
  easing: 'ease-out', once: true,
});

Live — scroll it

Pro Plan
Everything you need
For teams shipping fast.
$49/mo
  • Unlimited projects
  • scrollAnimate + scrollText
  • Zero dependencies
  • MIT license

Install

terminal
npm i svg-scroll-draw

MIT licensed, zero runtime dependencies. Every API is a separate entry point, so you only ship what you import. Full API reference →