Chapter 03 of 11Part 1 · Principles

Staggered animation and sequencing

How to offset a group of animations so they read in order, and how to keep the whole reveal under a second.

9 minBy Zuzo StudioUpdated

9 min

In this chapter you will

  • explain the difference between stagger, overlap and sequence
  • work out the total time of a reveal and keep it within a budget
  • stagger the words and buttons of your hero in plain CSS

Before you startThis builds on CSS easing functions and timing.

Check your understanding

3 questions

Q1Ten items share a 300ms animation with an 80ms stagger. When does the last one finish?

Show the answer

1020ms Nine gaps of 80ms is 720ms, and the last item then runs for 300ms, so the reveal ends at 1020ms.

Q2A grid of twelve product cards reveals on page load. Which order suits it best?

Show the answer

Row by row, in reading order Following reading order lets the motion guide the eye the way it would move anyway, from the first card to the last.

Q3Why does the project animate the heading words with transform but not from opacity 0?

Show the answer

So the heading is readable from the first frame and does not delay Largest Contentful Paint An invisible heading cannot count as painted. Moving it into place keeps it visible the whole time, so the page is judged loaded sooner.

Key takeaways

  1. A stagger gives each item in a group the same animation with a start time a fixed delay apart.
  2. Overlap, where the next item starts before the last finishes, makes a stagger feel like one movement.
  3. The order should follow reading order and lead with the most important element.
  4. The total time is the number of items minus one, times the stagger, plus the duration, so cap the delay on long lists.
  5. In CSS a stagger is an index multiplied into animation-delay, from a custom property or sibling-index().
Up next · Chapter 04 · 8 min CSS transitions: hover, focus and entry The transition shorthand, hover and focus states for every input, and how to animate elements in from display: none.

02FAQ

Questions on this chapter

Something else on your mind? Email the studio and a designer, not a salesperson, replies within a day.

How do you make a staggered animation in CSS?

Give each item the same animation and a different animation-delay, usually by setting an index custom property such as --i on each item and using calc(var(--i) * 60ms). In browsers that support it, sibling-index() can provide the index for you.

What is a good stagger delay?

For interface motion, usually between about 30ms and 100ms. Work backwards from the total time you are willing to spend on the reveal, and cap the delay so long lists do not take seconds to finish.