Notifications stack

Matt Perry

In this tutorial, we're going to build the Notifications stack example step-by-step.

This example is rated advanced 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:

Loading...

Checking Motion+ status…

The Notifications stack tutorial

is exclusive to Motion+

300+ examples & 40+ tutorials

Premium APIs

Motion Studio editing tools

alpha

Discord community

Early access

Lifetime updates

One-time payment, lifetime updates

Already joined?

Introduction

The Notifications stack example shows an iOS-inspired notification interface that expands and collapses with smooth spring animations. When collapsed, the notifications stack on top of each other with scaling and opacity effects. When opened, they spread apart to reveal all notifications individually.

This example uses two key APIs from Motion: the animate function to create spring-based animations, and the press function to handle click interactions. By organizing animation values into variant objects, we can easily animate between different states while keeping the code clean and maintainable.

Motion is supported by the best in the industry.