
The elastic button
Buttons, Hover, Text
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.
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 & 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>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
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 siteEach 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 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 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 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.
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.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #0f9f6e | The colour of the amount received, the lit icon and the changing balance. |
CURRENCY | script.js | $ | The currency symbol in front of the figures. |
AMOUNT | script.js | 1240 | The amount of the first payment. |
AMOUNT_TWO | script.js | 380 | The amount of the second payment, the one that lands in front. |
BALANCE | script.js | 7172.5 | The balance before the two payments. |
ROLL | script.js | 0.9 | The seconds the digits take to roll into place. |
SPRING | script.js | 1.6 | How far the spring overshoots when the notification arrives, opens and steps back. |
PEEK | script.js | 10 | The pixels the notification behind shows below the one in front. |
HOLD | script.js | 2.4 | The seconds the two notifications stay before the loop starts again. |
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.
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.
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.
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.
Tested on 27 October 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.