
The elastic button
Buttons, Hover, Text
The notice of a subscription whose payment was declined: the card icon on red, what happened, the attempts already made and “Retry now”. On tap a line runs along the bottom edge while the button says “Charging $29.00”; when the payment goes through, the notice turns green, the card in the icon gives way to a tick drawing itself and the third attempt lights up.
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 failed banner" 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>Payment failed banner</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">
<!-- the failed payment notice of a subscription: the attempts made so far, Retry now running the
new charge along the bottom edge, and the payment going through with its tick -->
<section class="pf" data-pf data-state="failed" role="status" aria-label="Billing notice">
<div class="pf__top">
<span class="pf__icon" aria-hidden="true"><svg viewBox="0 0 22 22"><g data-card><rect x="2.500" y="5" width="17" height="12" rx="2.600"></rect><path d="M2.500 9.200h17"></path></g><path class="pf__tick" data-tick pathLength="1" d="m6.200 11.400 3.300 3.300 6.400-7.200"></path></svg></span>
<div class="pf__text">
<strong class="pf__title"><span data-outtitle>Payment failed</span></strong>
<p class="pf__body"><span data-outbody>Your card ending 4821 was declined. We’ll try again on 2 December.</span></p>
</div>
</div>
<div class="pf__tries"><span class="pf__bars" aria-hidden="true"><i data-try class="is-bad"></i><i data-try class="is-bad"></i><i data-try></i></span><span class="pf__count"><span data-outcount>Attempt 2 of 3</span></span></div>
<div class="pf__actions">
<button class="pf__main" type="button" data-retry><span class="pf__face" data-face="retry">Retry now</span><span class="pf__face" data-face="busy">Charging $29.00</span><span class="pf__face" data-face="done">Done</span></button>
<button class="pf__link" type="button" data-update>Update card</button>
</div>
<i class="pf__run" data-run aria-hidden="true"></i>
</section>
<span class="live" aria-live="polite" data-live></span>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.
16 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 failed banner” from Animorio and fit it into my siteDeclined, in progress and paid are one attribute on the notice: from it come the colour of the ground, the edge and the icon. The texts of the three states live in a single object and all roll together.
The new attempt is a line at the bottom of the notice going from zero to the full width: when it ends it calls the successful payment. In a real app the server’s answer is what ends it.
Card and tick live in the same svg, one on top of the other. The card shrinks around the centre of the drawing and fades, the tick draws itself with stroke-dashoffset and the tile bounces.
| Name | File | Default | What it changes |
|---|---|---|---|
BAD | script.js | #d9432f | The colour of the notice and of the failed attempts. |
GOOD | script.js | #128a5e | The colour of the successful payment. |
CHARGE | script.js | 1.7 | How many seconds the new attempt lasts. |
SPRING | script.js | 1 | How much the icon and the button bounce. |
At the top of the account or billing page of a subscription service, when a renewal did not go through; the same notice with its “retry” carries a failed send, an interrupted backup, a failed sync or a document that did not upload.
The notice is at most 340 pixels wide and about 190 tall, and narrows with the screen: the sentence wraps by itself and always keeps two lines of room, so the height does not jump between states. Button and link are 44 pixels tall.
No running line: after the attempt’s wait the notice fades to green, with the tick already drawn and the texts changing without rolling. The icon does not wobble. The demo’s pointer does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.2 KB; the libraries: GSAP 28 KB.
Tested on 28 November 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.
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.