
The elastic button
Buttons, Hover, Text
The button of a business expenses app, on black: a graphite pill with a paper receipt in a small well, «Approve expense», the café and the reason under it and the amount on the right. Pressed, the receipt lifts and leans, a mint line reads it twice and every printed line it crosses turns mint, the amount is matched and boxed, and three thin segments fill one per check (Reading receipt, Checking policy, Within budget) while the ring runs around the well. Then the receipt drops into the pill, the mint disc with a check springs into its place, the pill lights up mint and says «Approved» with the payout day; coming near it offers «Undo approval».
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>
<!--
"Approve expense 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 Approve expense button with the receipt passing the checks</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>
<!-- one gesture: approving an expense in a finance app. The pill holds the receipt on a small paper slip. Pressed,
the slip lifts, a mint scan line reads it line by line, the amount gets matched, three checks fill a hairline
(receipt, policy, budget) and the slip drops into the pill as a mint disc with a check: «Approved» -->
<button class="btn" type="button" data-btn aria-label="Approve expense, Corso Coffee, team lunch, 86.40 dollars">
<span class="btn__body" data-body>
<span class="btn__wash" data-wash aria-hidden="true"></span>
<span class="btn__edge" aria-hidden="true"></span>
<span class="btn__sheen" data-sheen aria-hidden="true"></span>
<span class="well" aria-hidden="true">
<span class="well__hole"></span>
<span class="slip" data-slip>
<span class="slip__paper">
<span class="slip__head"></span>
<span class="slip__row" data-row></span>
<span class="slip__row slip__row--s" data-row></span>
<span class="slip__row" data-row></span>
<span class="slip__total" data-row></span>
<span class="slip__scan" data-scan></span>
</span>
</span>
<span class="seal" data-seal>
<svg viewBox="0 0 40 40"><path class="seal__check" data-check d="M13.6 20.4l4.3 4.3 8.6-9.2"></path></svg>
</span>
<svg class="ring" viewBox="0 0 40 40">
<circle class="ring__fill" data-ring cx="20" cy="20" r="19"></circle>
</svg>
</span>
<span class="txt txt--rest" data-rest>
<span class="txt__main">Approve expense</span>
<span class="txt__sub" data-merchant>Corso Coffee · Team lunch</span>
</span>
<span class="txt txt--run" data-run>
<span class="roll" data-roll>
<span class="roll__item" data-step>Reading receipt</span>
<span class="roll__item" data-step>Checking policy</span>
<span class="roll__item" data-step>Within budget</span>
</span>
<span class="segs" data-segs>
<span class="seg"><span class="seg__fill" data-seg></span></span>
<span class="seg"><span class="seg__fill" data-seg></span></span>
<span class="seg"><span class="seg__fill" data-seg></span></span>
</span>
</span>
<span class="txt txt--done" data-done>
<span class="txt__main">Approved</span>
<span class="txt__sub swap">
<span class="swap__a" data-payout>Paid out Nov 28</span>
<span class="swap__b">
<svg class="undo" viewBox="0 0 16 16" aria-hidden="true"><path d="M5.6 4.2 3 6.8l2.6 2.6M3.4 6.8h5.8a3.4 3.4 0 0 1 0 6.8H7"></path></svg>
Undo approval
</span>
</span>
</span>
<span class="amount" data-amount>
<span class="amount__box" data-box aria-hidden="true"></span>
<span class="amount__txt" data-amount-txt>$86.40</span>
</span>
</span>
</button>
<span class="sr" aria-live="polite" data-live></span>
<svg class="pointer" data-pointer viewBox="0 0 24 24" aria-hidden="true">
<path d="M5 3.2 18.6 13l-6.1.9 3.6 6.6-2.6 1.4-3.6-6.6L5.3 19.6z"></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.
26 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 “Approve expense button” from Animorio and fit it into my siteThe receipt is a 22 by 30 pixel box with a warm gradient and a polygon clip-path that draws the torn teeth at the bottom; the printed lines are one-and-a-half-pixel spans, the total thicker and darker. The resting lean sits on the child (rotate in CSS) while GSAP moves the parent, so the two transforms never cancel each other.
The mint line is a one-and-a-half-pixel span with two box-shadows for the glow, moved on y by GSAP down and back up. Each line turns mint with a backgroundColor tween placed in the timeline at the moment the scan reaches its height, worked out from the line position divided by the travel of the scan.
The check time is split into three equal steps: for each one the label comes in from below with yPercent and back.out inside an 18-pixel box with overflow hidden, the segment fills with scaleX from the left, and at the end a brightness keyframe and a 0.993 scale on the pill give the small snap of a check that passed.
The receipt drops 14 pixels, shrinks and fades with power3.in; the mint disc arrives with elastic.out and MOLLA and the check draws with strokeDashoffset on the length read from getTotalLength. The green light under the pill is a CSS variable (--alone) inside the box-shadow of a ::before, animated by GSAP: the shadow sits outside the pill’s overflow hidden and is never cut.
The state lives in one variable: at rest a click approves, during the checks it cancels (the timeline stops and everything goes back), when approved it undoes the approval. The Paid out and Undo approval swap is CSS only, on hover inside @media (hover: hover), on keyboard focus and on the is-near class the drawn pointer uses.
| Name | File | Default | What it changes |
|---|---|---|---|
IMPORTO | script.js | $86.40 | The expense amount, on the right of the pill. |
NEGOZIO | script.js | Corso Coffee · Team lunch | Where and why the money was spent, under the label. |
PAGAMENTO | script.js | Paid out Nov 28 | When the reimbursement arrives, in the approved pill. |
DURATA | script.js | 2.4 | How long the three checks take together, in seconds. |
SOLLEVA | script.js | 5 | How many pixels the receipt lifts while it is read. |
MOLLA | script.js | 0.42 | How soft the spring of the arriving disc is (lower bounces more). |
ATTESA | script.js | 2.6 | How long it stays approved before the drawn pointer undoes it, in seconds. |
In expense and reimbursement apps, in a manager’s approval panel, in accounting software, in corporate cards and business banking apps: anywhere an action approves a payment after automatic checks.
The same 60-pixel pill, 88 per cent of the screen wide up to 340 pixels; the reason for the expense is cut with an ellipsis if it does not fit. A tap approves, a tap during the checks cancels and a tap on the approved pill undoes it; without hover, Undo approval shows on focus.
No jumps, springs or reflections: the labels fade one after another, the segments light up without sliding, the receipt lines fade to mint, the ring fills and at the end the receipt fades into the mint disc with the check already drawn. The drawn pointer is hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.8 KB; the libraries: GSAP 28 KB.
Tested on 15 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.
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.