Loading: Pulse dots

Matt Perry
In this tutorial, we're going to build the Loading: Pulse dots example step-by-step.
This tutorial is rated beginner difficulty, which means we'll spend some time explaining the Motion APIs that we've chosen to use (and why), and also any browser APIs we encounter that might be unfamiliar to beginners.
Here's a live demo of the example we're going to be creating:
Introduction
The Pulse dots example shows how to create a classic three-dot loading animation where each dot pulses in sequence. This common loading indicator pattern is found in messaging apps and loading states.
This example uses the animate function and the stagger function to create a wave effect across multiple elements with minimal code.
Get started
Let's start with the basic HTML structure:
Let's animate!
Import from Motion
Import the functions we need:
Select the dots
Get references to all the dot elements:
Create the pulsing animation
Now animate all the dots with a single call:
The scale array [1, 1.5, 1] creates a keyframe animation where each dot starts at normal size, grows to 1.5x, then returns to normal.
The key to the wave effect is delay: stagger(0.2). This tells Motion to delay each dot's animation by 0.2 seconds compared to the previous one. The first dot starts immediately, the second after 0.2s, and the third after 0.4s.
Conclusion
We've built a smooth pulsing dots animation using Motion's animate and stagger functions. With just a few lines of code, we created a professional loading indicator that sequences animations across multiple elements.


