stagger() function generates staggered delays for multiple animated elements, allowing you to create wave-like or cascading animation effects.
Syntax
Parameters
The delay value or range to distribute across elements:
- Single value: Same delay increment for each element
- Array range: Interpolates between start and end values
- Supports units like ‘ms’, ‘s’, etc.
Configuration options for stagger behavior:
Returns
A stagger function that calculates delays for each target element.
Examples
Basic Stagger
Apply a 100ms delay increment between elements:Stagger with Range
Interpolate delays from 0ms to 1000ms:Stagger from Center
Start the stagger effect from the center element:Grid-based Stagger
Create 2D stagger effects for grid layouts:Grid with Axis Direction
Stagger along a specific axis in a grid:Stagger with Easing
Apply easing to the stagger distribution:Random Stagger Order
Randomize the stagger sequence:Reversed Stagger
Reverse the stagger direction:Use Cases
List Animations
Animate menu items or list entries with cascading effects
Grid Layouts
Create wave patterns across image galleries or product grids
Text Effects
Animate letters or words with sequential timing
Loading States
Build skeleton loaders with staggered placeholder animations
Notes
The stagger function is calculated once and cached for performance. The calculation considers the total number of targets and their positions.