animate()
Tween CSS, attributes, SVG geometry and plain JS objects from one call.
anime.js 4.5.0 · 24.5 KB · no dependencies
Six live demos of the v4 API — staggered reveals, easing curves, sequenced timelines, SVG line-draw and morph, throwable drag physics and per-character type. Every snippet below is copy-paste ready.
Whole library, every feature — before any per-module tree-shaking.
No runtime dependencies, no build step required — one ES module.
Latest npm release. Layout, Text and Adapters are the newest sections.
Everything animates through the same engine. Hover a card to see a one-line
tween fire; the grid itself is revealed by stagger() as you scroll.
Tween CSS, attributes, SVG geometry and plain JS objects from one call.
Label, position and replay sequences down to the millisecond.
Lock playback to scroll position, or fire at precise thresholds.
Draw paths, follow motion paths, morph shapes with matched point counts.
Drag, snap, flick and spring back with a configurable release spring.
Split into lines, words and characters, then animate each one.
animate('.card', {
y: ['100%', '0%'], opacity: [0, 1],
delay: stagger(70), ease: 'out(3)',
});
The only difference is the curve. Replay to compare how each one accelerates, overshoot-free, into its final state.
animate(bar, {
scaleX: [0.06, 1], duration: 1500,
ease: bar.dataset.ease, loop: true, alternate: true,
});
A 14-bar equaliser built from two .add() calls: one sweep in
with stagger(), one sweep back from the last bar.
createTimeline({ loop: true, defaults: { duration: 460, ease: 'inOutQuad' } })
.add('.bar', { scaleY: [0.18, 1] }, stagger(50))
.add('.bar', { scaleY: [1, 0.18] }, stagger(50, { from: 'last' }));
Left: a path draws itself as it enters the viewport. Right: two shapes melt into each other on a loop.
animate(svg.createDrawable(path), { draw: ['0 0', '0 1'], ease: 'inOutQuad' });
animate('#blob-a', { d: svg.morphTo('#blob-b', 0.33), loop: true, alternate: true });
Drag the disc and let go. releaseEase is a real spring —
stiffness and damping, evaluated every frame.
held at rest · grab and throw inside the board
createDraggable('.knob', {
container: '.board', containerPadding: 10,
releaseEase: spring({ stiffness: 120, damping: 7 }),
});
splitText() wraps every character, word and line in its own
element and hands them back as arrays. Then it is just stagger().
const { chars } = splitText('.split-title', { words: { wrap: 'clip' }, chars: true });
animate(chars, { y: ['110%', '0%'], delay: stagger(14), ease: 'out(3)' });