Skip to content
animorio
IT
All components

Payment received toast

Notifications, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.2 KBGSAP 28 KBFreeDownload the zip

The notification of a payments app for freelancers, on white, in the style of product interface pieces: “Payment received” from Halden Studio drops in on a spring, the icon lights up drawing the arrow into the tray and +$1,240.00 rolls up digit by digit, while the balance beside it changes only in the digits that need to. Then it steps back and a second, smaller one lands stacked in front; under the pointer the notification opens and shows View invoice.

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>
<!--
  "Payment received toast" 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 payment received toast with the rolling amount</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>
    <!-- the notification of a payments app for freelancers: it drops in, the icon lights up, the amount rolls up digit by
         digit and the balance beside it updates; then it steps back on a spring and a second payment lands in front.
         Hovering opens the front one on View invoice -->
    <section class="wrap" data-wrap aria-label="Notifications">
      <div class="stack" data-stack aria-live="polite">
        <article class="note" data-note data-invoice="INV-2041" tabindex="0">
          <div class="note__row" data-row>
            <span class="ico" data-ico aria-hidden="true">
              <span class="ico__glow"><i class="ico__shine" data-shine></i></span>
              <svg viewBox="0 0 24 24" data-icon><path class="ico__tray" data-tray d="M4.5 13.5v3.2a2.6 2.6 0 0 0 2.6 2.6h9.8a2.6 2.6 0 0 0 2.6-2.6v-3.2"></path><path class="ico__arrow" data-arrow d="M12 4.6v9.6M8.2 10.6l3.8 3.8 3.8-3.8"></path></svg>
              <b class="ico__badge" data-badge>2</b>
            </span>
            <div class="note__text">
              <p class="note__title"><span class="note__head" data-title>Payment received</span><span class="note__when">now</span></p>
              <p class="note__from">From <b data-client>Halden Studio</b> · INV-2041</p>
            </div>
            <div class="note__money">
              <p class="amount" data-amount></p>
              <p class="balance"><svg class="balance__up" data-up viewBox="0 0 10 10" aria-hidden="true"><path d="M2.4 6.2 5 3.6l2.6 2.6"></path></svg><span class="balance__label">Balance</span><span class="balance__value" data-balance></span></p>
            </div>
          </div>
          <div class="note__more" data-more>
            <p class="note__meta"><span class="note__brand">Corvo · </span>Bank transfer · 2:41 PM</p>
            <button class="view" type="button" data-view tabindex="-1">
              <span>View invoice</span>
              <span class="view__arr" data-arr aria-hidden="true"><svg viewBox="0 0 16 16"><path d="M3.5 8h8.6M8.6 4.4 12.2 8l-3.6 3.6"></path></svg></span>
            </button>
          </div>
        </article>

        <article class="note" data-note data-invoice="INV-2042" tabindex="0">
          <div class="note__row" data-row>
            <span class="ico" data-ico aria-hidden="true">
              <span class="ico__glow"><i class="ico__shine" data-shine></i></span>
              <svg viewBox="0 0 24 24" data-icon><path class="ico__tray" data-tray d="M4.5 13.5v3.2a2.6 2.6 0 0 0 2.6 2.6h9.8a2.6 2.6 0 0 0 2.6-2.6v-3.2"></path><path class="ico__arrow" data-arrow d="M12 4.6v9.6M8.2 10.6l3.8 3.8 3.8-3.8"></path></svg>
              <b class="ico__badge" data-badge>2</b>
            </span>
            <div class="note__text">
              <p class="note__title"><span class="note__head" data-title>Payment received</span><span class="note__when">now</span></p>
              <p class="note__from">From <b data-client>Mirren &amp; Co</b> · INV-2042</p>
            </div>
            <div class="note__money">
              <p class="amount" data-amount></p>
              <p class="balance"><svg class="balance__up" data-up viewBox="0 0 10 10" aria-hidden="true"><path d="M2.4 6.2 5 3.6l2.6 2.6"></path></svg><span class="balance__label">Balance</span><span class="balance__value" data-balance></span></p>
            </div>
          </div>
          <div class="note__more" data-more>
            <p class="note__meta"><span class="note__brand">Corvo · </span>Card payment · 2:44 PM</p>
            <button class="view" type="button" data-view tabindex="-1">
              <span>View invoice</span>
              <span class="view__arr" data-arr aria-hidden="true"><svg viewBox="0 0 16 16"><path d="M3.5 8h8.6M8.6 4.4 12.2 8l-3.6 3.6"></path></svg></span>
            </button>
          </div>
        </article>
      </div>
    </section>

    <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.

39 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 “Payment received toast” 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 white background, the notification of Corvo, a made-up payments app for freelancers: a white card seventy pixels tall with round corners, a barely visible border and a wide soft shadow. It drops from the top on a short spring, while the title Payment received narrows on the font’s width axis into place. On the left the icon, a tray drawn in strokes inside a grey tile: the tile turns pale green, swells a touch and settles, the arrow draws itself down into the tray, the tray takes a one-pixel knock and a white glint crosses the tile. Under the title, From Halden Studio and the invoice number. On the right +$1,240.00 rolls in: every digit is a column holding a strip of ten numbers that climbs a full round, in a wave from the left, and lands with a one-pixel settle; the columns are all the same width, like tabular figures, so nothing jitters. Then the balance below, Balance $7,172.50, becomes $8,412.50: only the digits that change roll, the balance turns green and back to grey, and a small drawn arrow rises beside it and fades. A drawn pointer passes over it: the notification stretches on a spring, the shadow widens and below a thin line appear Corvo · Bank transfer · 2:41 PM and the black View invoice button; pressed, the button dips, the card’s shadow tightens and the arrow slips out to the right and back in from the left. When the pointer leaves the notification closes, steps back on the spring, smaller and lighter with its content dimmed, and in front drops the second, +$380.00 from Mirren & Co, its balance going to $8,792.50 and a small black badge with a 2 on the icon. The pointer opens this one too, and the one behind moves down with it; in the end they rise away together and the loop starts again. It really works too: with a mouse, by touch (a tap opens and closes) and with the keyboard.

How it works

Digits on a strip

Each digit is a box 1.2 em tall with hidden overflow, holding a strip of twenty-one cells: a blank one and two rounds from zero to nine. The digit is picked by moving the strip with yPercent of −100 per cell over 21. The box is as wide as the widest digit it holds, so the columns are all equal like tabular figures, without changing how the digits are drawn.

The amount arriving

The new amount starts from the blank cell and goes to the same digit in the second round, so each column runs through ten numbers. The columns start 50 ms apart from the left with power3.out; when they are almost still the box drops 1.2 pixels and comes back with back.out(3), the settle you can feel. At the end each strip quietly returns to the first round, ready for the next.

The balance moving on

The old and new balance have the same shape: they are compared character by character and only the column that changes rolls, always upwards (if the new digit is smaller it goes to the second round). If the length changes, the balance redraws with a fade.

The stack

The notifications are absolute at the top of the box. The front one sits at zero; the one behind moves down by however much taller the front one is, plus ten pixels, and shrinks 5.5 per cent from its bottom edge: so its edge always peeks below, even while the front one is open. A single back.out tween takes them all to their place, to arrive, open and step back.

The autopilot

A timeline with repeatRefresh brings the notifications in, takes the drawn pointer to the card and to View invoice reading their real position each time, and calls the same functions as the mouse. At the first real gesture it steps aside and comes back after eight quiet seconds.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#0f9f6eThe colour of the amount received, the lit icon and the changing balance.
CURRENCYscript.js$The currency symbol in front of the figures.
AMOUNTscript.js1240The amount of the first payment.
AMOUNT_TWOscript.js380The amount of the second payment, the one that lands in front.
BALANCEscript.js7172.5The balance before the two payments.
ROLLscript.js0.9The seconds the digits take to roll into place.
SPRINGscript.js1.6How far the spring overshoots when the notification arrives, opens and steps back.
PEEKscript.js10The pixels the notification behind shows below the one in front.
HOLDscript.js2.4The seconds the two notifications stay before the loop starts again.

Try them in the Playground

When to use it

For a payments, invoicing or bookkeeping app for freelancers and small studios, an online bank account, an income dashboard, a shop that notifies its sellers: anywhere a payment arrives and is worth feeling, with the amount and the balance updating.

On phones

The notification takes the full width minus the margins, up to 392 pixels; under 420 pixels, so on every phone, the icon drops to 34, the time and the app name go and the text tightens, so Payment received stays whole. On a phone there is no hover: a tap opens and closes the notification, and View invoice is pressed with a finger.

With reduced motion

No springs, flights or rolling: the notifications appear and disappear with fades, the amount and the balance arrive already right with a fade, the icon lights up in colour only, the one behind does not stay peeking and the drawn pointer stays hidden. Opening on View invoice works the same.

Pitfalls

  • With Mona Sans’ tabular figures (font-variant-numeric) the zero is slashed and the one has a foot: the amount looked typed in a code editor. The digits keep their normal shapes and the columns make them tabular, because each is as wide as the widest digit on its strip.
  • On a phone the title was cut to “Payment receiv…”: the balance column took the room. Under 420 pixels the time and the app name go, the icon drops to 34 and the text tightens by half a pixel.
  • The drawn pointer came back while a person was using the notification, because the autopilot timeline kept fading it in: its opacity is a function read at the start of each tween, and it is zero when the pilot has stepped aside.
  • In reduced motion the icon’s arrow was a dot: it was still hidden by the dash of its animation. There the stroke is set whole straight away and only fades in.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 27 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 components