Stagger

Stagger is used to sequence animations across multiple elements.
You can control delay, layout, direction, and repetition for fine-tuned effects.

You can use stagger inside tweens and timelines.


Basic stagger

This example offsets each animation by 0.25s to create a ripple effect.


animatry.to('.box', {
x: maxWidth,
scale: 0.5,
rotate: 45,
stagger: 0.25, // delay between each element
repeat: -1,
alternate: true,
})

Layout-based stagger

With layout-aware staggering, you can animate from the center or other spatial positions.
This layout uses layout: 'distance' to calculate delays based on element position.


animatry.to('.box', {
scale: 0.5,
rotate: 135,
borderColor: 'cyan',
stagger: {
layout: 'distance',
from: 'center',
duration: 1,
repeat: 1,
iterationDelay: 0.5,
alternate: true,
},
repeat: 1,
alternate: true,
})

Stagger Options

When using an object as the stagger value, you can control how timing is distributed.

Option
Description
each
Time between each element (auto-calculated if duration is given).
duration
Total stagger span. Overrides `each` if both are set.
from
`start`, `center`, `end`, `[x,y]`, or named anchors like "top left".
layout
`grid`, `distance`, or `[rows, cols]`. Needed for layout-based staggering.
axis
`x`, `y`, or `xy`. Controls which directions affect timing.
invert
Flips the calculated stagger order.
repeat
Repeat each staggered tween.
iterationDelay
Delay between internal repeats.
alternate
Alternate direction within each staggered tween.