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 team wiki's pricing page. Every part of every plan — badge, name, price, features, button — rises on its own scrollAnimate a few percent of scroll after the last, left plan first.
import { scrollAnimate } from 'svg-scroll-draw';
document.querySelectorAll('[data-part]').forEach((el) => {
const plan = Number(el.dataset.plan);
const part = Number(el.dataset.part);
const start = 92 - plan * 3 - part * 3; // left plan first, top to bottom
scrollAnimate(el, {
props: {
opacity: [0, 1],
transform: ['translateY(22px)', 'translateY(0)'],
},
trigger: { start: `top ${start}%`, end: `top ${start - 30}%` },
easing: 'ease-out',
once: true,
});
});
A team wiki’s pricing page
Tessera
Related examples
Make your own in the CSS scroll-driven animation generator: set it up, watch it run, copy the code.
MIT licensed, zero runtime dependencies. Every API is a separate entry point, so you only ship what you import. Full API reference →