Skip to content
animorio
IT
Back to the library

Notification drawer

Physics, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.7 KBGSAP 28 KBFreeDownload the zip

A bare phone screen and a grip: pulled down, the notification drawer follows the finger, stretches like a rubber band past the bottom and opens on a short spring, while the notifications arrive staggered and settle by a pixel. Let go before halfway and it goes back up; a notification swiped sideways flies off and the others rise to fill the gap. In the style of product micro-interactions, one gesture only: Drag.

The code

A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.

<!doctype html>
<!--
  "Notification drawer" from Animorio · https://animorio.com
  License: free on your own sites and your clients’ sites, paid work included.
  Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>The notification drawer you pull down</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- a phone screen: pull the grip down and the notification drawer follows the finger, stretches like a rubber
         band past the bottom and opens or springs back up; swipe a notification sideways to clear it -->
    <div class="phone" data-phone>
      <div class="screen" data-screen>
        <div class="wall" data-wall aria-hidden="true">
          <p class="wall__date">Monday, 26 October</p>
          <p class="wall__time">9:41</p>
        </div>
        <div class="scrim" data-scrim aria-hidden="true"></div>

        <section class="drawer" data-drawer aria-label="Notifications">
          <div class="drawer__inner" data-inner>
            <header class="drawer__head" data-head>
              <p class="drawer__title">Notifications <span class="drawer__count" data-count>5</span></p>
              <button class="drawer__clear" type="button" data-clear>Clear all</button>
            </header>

            <ul class="list" data-list>
              <li class="note" data-note>
                <button class="note__x" type="button" aria-label="Dismiss" data-x><svg viewBox="0 0 12 12"><path d="M3.5 3.5l5 5M8.5 3.5l-5 5"></path></svg></button>
                <div class="note__icon"><svg viewBox="0 0 24 24"><rect x="3.5" y="6" width="17" height="12" rx="2.5"></rect><path d="M3.5 10h17M7 14.5h3"></path></svg></div>
                <div class="note__body">
                  <p class="note__meta"><span>Ledgerly</span><time>now</time></p>
                  <p class="note__title">Payment received</p>
                  <p class="note__text">$1,240.00 from Maris Studio</p>
                </div>
              </li>
              <li class="note" data-note>
                <button class="note__x" type="button" aria-label="Dismiss" data-x><svg viewBox="0 0 12 12"><path d="M3.5 3.5l5 5M8.5 3.5l-5 5"></path></svg></button>
                <div class="note__icon"><svg viewBox="0 0 24 24"><path d="M4 8.5 12 4.5l8 4v7l-8 4-8-4Z"></path><path d="M4 8.5l8 4 8-4M12 12.5v7"></path></svg></div>
                <div class="note__body">
                  <p class="note__meta"><span>Tidepost</span><time>4m</time></p>
                  <p class="note__title">Out for delivery</p>
                  <p class="note__text">Arriving between 2:40 and 3:10 pm</p>
                </div>
              </li>
              <li class="note" data-note>
                <button class="note__x" type="button" aria-label="Dismiss" data-x><svg viewBox="0 0 12 12"><path d="M3.5 3.5l5 5M8.5 3.5l-5 5"></path></svg></button>
                <div class="note__icon"><svg viewBox="0 0 24 24"><rect x="4" y="5.5" width="16" height="14.5" rx="2.5"></rect><path d="M4 10h16M8.5 3.5v4M15.5 3.5v4"></path></svg></div>
                <div class="note__body">
                  <p class="note__meta"><span>Agendo</span><time>12m</time></p>
                  <p class="note__title">Design review in 10 min</p>
                  <p class="note__text">Room 4B, with Ines and Tomas</p>
                </div>
              </li>
              <li class="note" data-note>
                <button class="note__x" type="button" aria-label="Dismiss" data-x><svg viewBox="0 0 12 12"><path d="M3.5 3.5l5 5M8.5 3.5l-5 5"></path></svg></button>
                <div class="note__icon"><svg viewBox="0 0 24 24"><path d="M8 8.5 4.5 12 8 15.5M16 8.5l3.5 3.5-3.5 3.5M13.5 6.5l-3 11"></path></svg></div>
                <div class="note__body">
                  <p class="note__meta"><span>Pulsar CI</span><time>26m</time></p>
                  <p class="note__title">Build passed on main</p>
                  <p class="note__text">142 checks in 2m 14s</p>
                </div>
              </li>
              <li class="note" data-note>
                <button class="note__x" type="button" aria-label="Dismiss" data-x><svg viewBox="0 0 12 12"><path d="M3.5 3.5l5 5M8.5 3.5l-5 5"></path></svg></button>
                <div class="note__icon"><svg viewBox="0 0 24 24"><path d="M5 6.5h14a1.5 1.5 0 0 1 1.5 1.5v8a1.5 1.5 0 0 1-1.5 1.5h-8l-4 3v-3H5A1.5 1.5 0 0 1 3.5 16V8A1.5 1.5 0 0 1 5 6.5Z"></path></svg></div>
                <div class="note__body">
                  <p class="note__meta"><span>Wren</span><time>1h</time></p>
                  <p class="note__title">Maris</p>
                  <p class="note__text">Sending the final files tonight</p>
                </div>
              </li>
            </ul>

            <div class="empty" data-empty aria-hidden="true">
              <svg viewBox="0 0 24 24"><path d="M6.5 16.5V11a5.5 5.5 0 0 1 11 0v5.5l1.5 1.5h-14Z"></path><path d="M10 20.5a2 2 0 0 0 4 0"></path></svg>
              <p>You’re all caught up</p>
            </div>
          </div>

          <div class="grip" data-grip>
            <p class="grip__label" data-lip><span data-lip-n>5</span> notifications</p>
            <span class="grip__bar" data-bar></span>
          </div>
        </section>

        <div class="status" aria-hidden="true">
          <span class="status__time">9:41</span>
          <span class="status__icons">
            <svg viewBox="0 0 18 12"><rect x="0" y="8" width="3" height="4" rx="0.8"></rect><rect x="5" y="5.5" width="3" height="6.5" rx="0.8"></rect><rect x="10" y="3" width="3" height="9" rx="0.8"></rect><rect x="15" y="0" width="3" height="12" rx="0.8" opacity="0.3"></rect></svg>
            <svg viewBox="0 0 26 12"><rect x="0.6" y="0.6" width="21" height="10.8" rx="3" fill="none" stroke="currentColor" stroke-width="1.1" opacity="0.4"></rect><rect x="2.3" y="2.3" width="14" height="7.4" rx="1.6"></rect><path d="M23.4 4.2v3.6c.8-.3 1.3-1 1.3-1.8s-.5-1.5-1.3-1.8Z" opacity="0.4"></path></svg>
          </span>
        </div>
      </div>
    </div>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="script.js"></script>
</body>
</html>

Playground

Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.

43 values to change

Or ask your AI assistant for it

With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:

Take “Notification drawer” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a very light grey there is a white phone with a thin frame: at the top the time and the signal and battery icons, on the warm background the date and a large 9:41. At the top of the screen you only see the glass edge of the drawer, reading 5 notifications, and a grey grip. Grab the grip and pull: it widens and turns orange, the frosted glass drawer comes down following the finger, the background darkens and the clock steps back a little. As it comes down the notifications arrive one after the other, each with its own little spring that makes it settle: a payment received from Ledgerly, a parcel out for delivery from Tidepost, a meeting in ten minutes in Agendo, a build passed on Pulsar CI and a message on Wren. Pulled past the bottom, the drawer keeps coming but less and less, like a rubber band, and the notifications spread apart; let go, it goes back to its place with a short bounce. Let go before halfway and it goes back up, past halfway or with a quick flick it opens. A notification swiped sideways tilts, fades and flies off, and the ones below rise to fill the gap with a one pixel settle; with the pointer over it a small x appears to close it, and Clear all sends them all off in a row. The orange number rolls at each notification removed, and when none is left the bell appears with You’re all caught up. A drawn pointer does it all by itself: a short pull that goes back up, a long one past the bottom, a sideways swipe, the x, and the drawer flicked back up; then it starts again.

How it works

The drawer parked above the screen

The drawer is as tall as the screen and is shifted up by its whole height minus the grip, so when closed only that strip shows. Everything inside the phone is measured in cqh, the container units: the phone has container-type size and every measure follows its height, so it shrinks as one piece.

The finger and the rubber band

While dragging, the raw position is the finger’s; past the bottom it goes through a rubber band curve, d times (1 minus 1 over (x times RUBBER over d plus 1)), which grows less and less and never goes past d. Above the closed drawer there is the same curve, shorter. The positions of the last ninety milliseconds give the speed.

The spring that decides

On release the drawer projects where it would land with its speed over 0.12 seconds: past halfway it opens, below it goes back up. A damped spring, integrated in four steps per frame in GSAP’s ticker, starts with the finger’s speed; BOUNCE takes away damping and leaves a short bounce.

The staggered notifications

Each notification has its own vertical spring and its own opacity: it switches on when the opening goes past 0.3 plus STAGGER times its position, so they arrive one after the other with the same finger. Pulled past the bottom, each one moves down a little more than the one before and the stack spreads.

The sideways swipe

After six pixels the axis is decided: sideways moves only the notification, which tilts and fades with the distance. Past SWIPE of the width or with a quick flick it flies off; then its height, margins and padding go to zero, and the ones below, rising by themselves, do a pixel and a half up and down.

Values to change

NameFileDefaultWhat it changes
SPRINGscript.js1How stiff the spring that opens and closes the drawer is: higher is snappier.
BOUNCEscript.js0.22How much the drawer bounces when it lands.
RUBBERscript.js0.55How far it lets itself be pulled past the bottom before the rubber band holds it.
STAGGERscript.js0.07How staggered the notifications arrive as the drawer comes down.
SWIPEscript.js0.32The share of the width past which a released notification goes away.
ACCENTscript.js#ff5a36The colour of the grabbed grip and of the notification count.
HOLDscript.js1.2The seconds of pause before the autopilot starts again.

Try them in the Playground

When to use it

For the showcase of a phone app, to show how a product’s alerts arrive (payments, deliveries, meetings, builds) or as a piece of a prototype: it is the gesture everyone knows, with physics you can feel.

On phones

The same animation with adapted sizes: the phone is sized on the height and the width of the window and everything inside follows it; you pull with your finger and swipe the notifications sideways with your finger.

With reduced motion

No springs and no movement: the drawer opens and closes with a fade, the notifications appear and disappear by fading, without flying sideways, and the clock below stays still.

Pitfalls

  • Pulling past the bottom left an uncovered sliver above the drawer: a ::before of the same glass, taller than the rubber band’s travel, covers it.
  • The spring integrated once per frame, with high stiffness, blew up at 30 frames per second: four small steps per frame keep it stable.
  • The axis is decided after six pixels and not before: a notification touched to push the drawer up, with a first pixel sideways, went off crosswise.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 8.7 KB; the libraries: GSAP 28 KB.

Testing

Tested on 26 October 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.

All animations