
The elastic button
Buttons, Hover, Text
The Send $40 button of an app for sending money to friends, with a single gesture: pressed, it squeezes, the amount leaves the pill and flies along a curve to the recipient’s avatar, which takes it with a little jump while a lime ring closes around it. Under the name the line becomes Paid $40, and the button fills with lime and says Sent with a drawn tick; after a moment it goes back to how it was.
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>
<!--
"Send money button" 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 Send money button whose amount flies to the avatar</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">
<!-- one gesture: press. A payment card of a money app between friends: the recipient on top, the Send $40 pill
below. Pressed, the amount leaves the pill and flies along a curve to the avatar, which takes it with a little
jump while a ring closes around it; the pill turns into Sent with a drawn tick, and after a moment comes back -->
<section class="pay" data-pay aria-label="Send money to Mara Quill">
<div class="to">
<span class="avatar" data-avatar>
<svg class="ring" viewBox="0 0 64 64" aria-hidden="true">
<circle class="ring__track" cx="32" cy="32" r="29"></circle>
<circle class="ring__line" data-ring cx="32" cy="32" r="29"></circle>
</svg>
<span class="avatar__face" data-face aria-hidden="true">
<span class="avatar__shine"></span>
<span class="avatar__initials">MQ</span>
</span>
</span>
<span class="to__text">
<span class="to__name">Mara Quill</span>
<span class="to__note" data-notewin><span class="note" data-note>Dinner at Osteria Lune</span></span>
</span>
</div>
<button class="send" type="button" data-send>
<span class="send__fill" data-fill aria-hidden="true"></span>
<span class="send__inner">
<svg class="tick" data-tickwrap viewBox="0 0 20 20" aria-hidden="true"><path data-tick d="M4.5 10.4 8.3 14 15.6 6.2"></path></svg>
<span class="send__label" data-win><span class="lab" data-lab>Send</span></span>
<span class="send__amount" data-amountwin><span class="amount" data-amount>$40</span></span>
</span>
</button>
</section>
<!-- the flying amount and its curve live on the stage, above everything -->
<svg class="path" data-pathsvg aria-hidden="true"><path data-path d=""></path></svg>
<span class="chip" data-chip aria-hidden="true">$40</span>
<p class="sr" aria-live="polite" data-live></p>
<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.
25 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 “Send money button” from Animorio and fit it into my siteThe flying tag is born exactly over the pill’s amount, measured with getBoundingClientRect against the stage; the real amount fades in the same frame and its window closes to zero width, so it looks as if it really came off.
Start and end are the centres of the amount and of the avatar; the control point sits halfway, moved right and up by part of the distance (the ARC knob). An object with t from 0 to 1 on power2.inOut moves the tag along the curve, tilts it a little in the direction it takes and shrinks it towards the end.
The same curve is an SVG path with 5 pixel dashes: the dash pattern only reaches as far as the tag has gone and then becomes a gap as long as the curve, so the line grows behind it and disappears on arrival.
The avatar rises 5 pixels and comes back with elastic.out, the face starts at 1.08 and settles, and the ring is a circle whose dash is as long as its circumference, uncovered in 0.75 seconds starting from twelve o’clock.
Send and Sent, the dinner line and the payment line live in windows one line tall: the old one goes up and out, only then the new one comes from below with back.out, and the window widens on the word as actually measured.
| Name | File | Default | What it changes |
|---|---|---|---|
AMOUNT | script.js | 40 | How much money the button sends. |
CURRENCY | script.js | "$" | The currency symbol, in front of the figure. |
FLIGHT | script.js | 0.95 | How long the amount’s flight to the avatar lasts, in seconds. |
ARC | script.js | 0.6 | How much the amount’s way curves (0 = straight). |
HOLD | script.js | 1.6 | How many seconds Sent stays before the button goes back to how it was. |
SQUEEZE | script.js | 0.96 | How much the button squeezes when you press it (1 = not at all). |
TRAIL | script.js | 1 | 1 = the dashed line marking the amount’s way, 0 = none. |
ACCENT | script.js | "#b9f06a" | The colour of money that has arrived: the flying amount, the ring and the Sent button. |
NOTE | script.js | "Dinner at Osteria Lune" | The line under the name, before the payment. |
In the button confirming a payment in an app for splitting costs with friends, in a digital wallet, in a tip to a creator, in a bank app or in a checkout where you pay a person: anywhere money goes from someone to someone else and it helps to see it arrive.
The same card, as wide as the screen up to 340 pixels, with the space between the avatar and the button shortening on low screens; a finger presses like the mouse and the amount takes the same curve. On a phone there is no hover, so the amount does not lean out before the tap.
No flight, jumps or squeezes: the amount fades out in the button, the ring fades in already closed, the button turns lime and the labels change with a fade. The drawn pointer does not run.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.3 KB; the libraries: GSAP 28 KB.
Tested on 29 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.