
The elastic button
Buttons, Hover, Text
The form for withdrawing from an app’s balance: the large amount, a thin bar showing what share of the balance leaves and four pills, 25%, 50%, 75% and Max. Tap a pill and the amount counts to that share, the bar lengthens, the fee comes off “You receive” and the button says how much is withdrawn. Confirm and a light runs through it, the tick appears and the available balance counts down.
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>
<!--
"Withdraw form" 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>Withdraw form</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 withdraw form of a money app: the percentage pills roll the amount, the balance bar shows the
share that leaves, the fee and what arrives are worked out again, and the button says how much -->
<form class="wd" data-wd aria-label="Withdraw" novalidate>
<header class="wd__head">
<h2>Withdraw</h2>
<p>Available <b data-avail></b></p>
</header>
<label class="wd__amount" data-amountbox>
<span class="wd__cur" aria-hidden="true">$</span>
<input data-amount type="text" inputmode="decimal" autocomplete="off" spellcheck="false" maxlength="9" aria-label="Amount in dollars">
</label>
<div class="wd__bar" aria-hidden="true"><span class="wd__out" data-out></span></div>
<div class="wd__pills" data-pills role="group" aria-label="Share of the balance">
<span class="wd__marker" data-marker aria-hidden="true"></span>
</div>
<dl class="wd__lines">
<div><dt>To</dt><dd>Everyday account, 4821</dd></div>
<div><dt>Fee</dt><dd data-fee></dd></div>
<div><dt>You receive</dt><dd class="wd__get"><span data-get></span></dd></div>
</dl>
<button class="wd__go" type="submit" data-go>
<span class="wd__gofill" data-gofill aria-hidden="true"></span>
<span class="wd__golabel"><svg viewBox="0 0 16 16" aria-hidden="true"><path data-gotick pathLength="1" d="M3.500 8.500l3 3 6-6.500"></path></svg><span data-golabel></span></span>
</button>
<span class="wd__say" data-say aria-live="polite"></span>
</form>
<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.
19 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 “Withdraw form” from Animorio and fit it into my siteThe pill works out its share of the balance and a tween takes a number there, rewritten in the field at each step with two decimals.
A single function reads the field and decides the bar (scaleX equal to amount over balance), what arrives, the red when the balance is exceeded and the button’s words.
A white element takes the x and width of the chosen pill on an elastic; the first time it appears by growing, and it goes away if you type by hand.
A band with scaleX from 0 to 1 crosses the button; at the end the available balance, which has a number of its own, counts to its new value.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #3b6cff | The colour of the balance bar, the active field and the light on the button. |
BALANCE | script.js | 2480 | The available balance, in dollars. |
FEE | script.js | 1.5 | The flat fee on each withdrawal. |
SPRING | script.js | 1 | How much the percentage marker bounces as it moves: 0.3 = a little, 2 = a lot. |
LOOP | script.js | true | Left alone, the demo’s pointer tries the percentages and confirms a withdrawal. |
In the wallet of a payments app, a sellers’ marketplace, a freelancers’ app or an exchange: wherever part of a balance is taken out.
The same card, 308 pixels wide at most: the field opens the number keyboard (inputmode decimal), the pills are 30 pixels tall and a quarter of the row wide, the button is 46 tall.
The amount, the bar and the numbers change at once without counting, the marker jumps onto the pill and the button changes its words without the light. The demo does not move by itself.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.3 KB; the libraries: GSAP 28 KB.
Tested on 22 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.