stagger
When animating elements with the animate function, it's possible to stagger animations across them using stagger()
.
Usage
Import stagger
from Motion.
By passing a duration, in seconds, to stagger
, the delay
of each element will be increased by that amount for each animation.
Options
stagger
accepts options via its second argument.
startDelay
Default: 0
The initial delay from which to calculate subsequent delays.
from
Default: "first"
Specifies which element in the array from which to stagger. Can be set as "first"
, "center"
, "last"
, or a number to specify an index.
ease
Default: "linear"
By passing an easing function, staggers can be redistributed through the total stagger time.
Any easing function or Motion easing is accepted, like a cubic bezier definition:
Name of an easing function:
Or a custom easing function: