iOS Notifications stack: Step-by-step tutorial

Matt Perry
In this tutorial, we're going to build the iOS Notifications stack example step-by-step.
This example is rated 3/5 difficulty, which means we assume you're already quite familiar with Motion (and JavaScript in general).
Here's a live demo of the example we're going to be creating:
Checking Motion+ status…
The iOS Notifications stack tutorial
is exclusive to Motion+
290+ examples & 35+ tutorials
Premium APIs
Visual editor for VS Code
alpha
Discord community
Early access
Lifetime updates
One-time payment, lifetime updates
Already joined?
Introduction
The iOS Notifications Stack example shows how to create an expandable stack of notification cards with smooth spring animations. When collapsed, the notifications are stacked on top of each other with a subtle scaling effect. When expanded, they spread out for better visibility, with a header appearing at the top.
In this tutorial, we'll learn to use several Motion for React APIs to create this effect:
Variants to define animation states
Motion components to animate DOM elements