from:
axis:
ease:

Play with the options above to see how it affects the animation and the code below. Click any box to have the stagger emanate outward from that specific index number, using the from:[index] syntax.

gsap.to(".box", {
  duration: 1,
  scale: 0.1,
  y: 40,
  ease: "power1.inOut,
  stagger: {
    grid: [7,15],
    from: "center",
    amount: 1.5
  }
});

How does it work?

All tweens recognize a stagger special property which can be an object, a number, or a function as described below:

Object

An object makes configuration simple. It may contain any of the following properties:

Number

A value of stagger: 0.1 would cause there to be 0.1 second between the start times of each tween. A negative value would do the same but backwards so that the last element begins first.

Function

The function is called once for each target/element in the array and should return the total delay from the starting position (not the amount of delay from the previous tween's start time). The function receives the following parameters:

  1. index [integer] - The index value from the list
  2. target [object] - The target in the list at that index value
  3. list [array | NodeList] - The targets array (or NodeList)

Repeat / Yoyo

If you put your repeat in the top level of the vars object of your tween like gsap.to(... {repeat:-1, stagger:{...}), it waits for all of the sub-tweens to finish before repeating the WHOLE sequence, but if you prefer to have each sub-tween repeat independently (so that as soon as each one completes, it immediately repeats itself), simply nest the repeat (and yoyo if necessary) inside the advanced stagger object, like gsap.to(... {stagger:{repeat:-1, ...}}); Think of it almost like the advanced stagger object is a vars object for the sub-tweens.

Video Explanation