
The elastic button
Buttons, Hover, Text
The «Download invoice» button of a billing app, on white, in the style of real product interface pieces: pressed, the arrow drops into the tray, the pill fills and a ring counts the time, while the invoice sheet rises out of the button, fills row by row and gets its Paid stamp. Then the corner folds, the PDF tag slides in and the sheet shrinks into the icon that falls into the button; a drawn check and «Saved · 84 KB» close the gesture.
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>
<!--
"Download invoice 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 Download invoice button that turns into the PDF</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>
<!-- an invoice card of a billing app: pressed, the button fills with progress, an invoice sheet rises out of it and
fills its rows, gets stamped, folds its corner and shrinks into a PDF icon that drops into the button, then «Saved» -->
<section class="inv" data-card aria-label="Ledgerbird invoice">
<header class="inv__head">
<svg class="inv__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 18.5V6.8c0-1 .8-1.8 1.8-1.8h7.4L19 9.8v8.7c0 1-.8 1.8-1.8 1.8H6.8c-1 0-1.8-.8-1.8-1.8Z"></path><path d="M14 5v4.6c0 .4.3.7.7.7H19"></path><path d="M8.6 14.6h6.8M8.6 17.2h4.2"></path></svg>
<p class="inv__brand">Ledgerbird <span>/ Invoices</span></p>
<p class="inv__state">Paid</p>
</header>
<div class="inv__body" data-body>
<div class="inv__top">
<div>
<p class="inv__no" data-no>INV-2048</p>
<p class="inv__client">Maple & Finch Studio</p>
</div>
<p class="inv__amount" data-amount>$1,284.00</p>
</div>
<p class="inv__meta">Issued Oct 1, 2026 <span aria-hidden="true">·</span> Paid Oct 24</p>
<ul class="inv__items">
<li><span>Brand workshop</span><span>$640.00</span></li>
<li><span>Icon set, 24 icons</span><span>$420.00</span></li>
<li><span>Revisions</span><span>$224.00</span></li>
</ul>
</div>
<footer class="inv__foot">
<button class="dl" type="button" data-btn>
<span class="dl__fill" data-fill aria-hidden="true"></span>
<span class="dl__icon" aria-hidden="true">
<svg class="dl__arrow" data-arrow viewBox="0 0 24 24"><path data-shaft d="M12 4.2v10.4"></path><path data-head d="M7.6 10.4 12 14.8l4.4-4.4"></path><path data-tray d="M4.8 15.6v2.2c0 1.1.9 2 2 2h10.4c1.1 0 2-.9 2-2v-2.2"></path></svg>
<svg class="dl__ring" data-ring viewBox="0 0 24 24"><circle class="ring__bg" cx="12" cy="12" r="8.2"></circle><circle class="ring__fg" data-ring-fg cx="12" cy="12" r="8.2"></circle></svg>
<svg class="dl__pdf" data-pdf viewBox="0 0 24 24"><path d="M6.2 3.6h8.2l4 4v12.2c0 .4-.3.6-.6.6H6.2c-.4 0-.6-.2-.6-.6V4.2c0-.4.2-.6.6-.6Z"></path><path d="M14.4 3.6v3.8c0 .2.1.3.3.3h3.7"></path><rect class="pdf__band" x="3.4" y="11.6" width="12.4" height="5.6" rx="1.2"></rect></svg>
<svg class="dl__check" data-check viewBox="0 0 24 24"><path data-check-path d="M5.6 12.4 10 16.6 18.6 7.6"></path></svg>
</span>
<span class="dl__label" data-label>Download invoice</span>
</button>
<p class="inv__file" data-file>PDF <span aria-hidden="true">·</span> A4</p>
</footer>
<div class="sheet" data-sheet aria-hidden="true">
<div class="sheet__paper" data-paper>
<div class="sheet__head">
<span class="sheet__brand">Ledgerbird</span>
<span class="sheet__word">Invoice</span>
</div>
<p class="sheet__no" data-sheet-no>INV-2048</p>
<p class="sheet__to">Billed to Maple & Finch Studio</p>
<div class="sheet__rows">
<div class="row" data-row><i class="sk"></i><span class="tx">Brand workshop</span><span class="am">$640.00</span></div>
<div class="row" data-row><i class="sk"></i><span class="tx">Icon set, 24 icons</span><span class="am">$420.00</span></div>
<div class="row" data-row><i class="sk"></i><span class="tx">Revisions</span><span class="am">$224.00</span></div>
</div>
<i class="sheet__rule" data-rule></i>
<div class="sheet__total"><span>Total</span><span data-total>$1,284.00</span></div>
<span class="sheet__stamp" data-stamp>Paid</span>
<span class="sheet__tag" data-tag>PDF</span>
</div>
<i class="sheet__flap" data-flap></i>
</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.
47 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 “Download invoice button” from Animorio and fit it into my siteThe icon slot holds four stacked SVGs: the arrow with its tray, the ring, the PDF document and the check. Each state lights only one, so the button never changes size because of its icon.
To change the label, measure the old width, set the new text, measure with width auto and go back to the old one; then GSAP goes to the new width with back.out and finally sets auto again. The label leaves upward and comes back from below with the wdth axis slightly wide and tightening.
The sheet already sits in its place in the card; the tween starts from a scale of 0.06 with the origin at the bottom centre, offset so that its bottom sits on the button’s icon: the distances are measured at that moment, with function values.
Each row has a grey bar underneath and the word above, cut by a clip-path inset that opens from the left; the bar fades while the word enters and the amount rises with a small bounce. BUILD_TIME is shared among the rows.
The folded corner is a CSS variable --f that cuts the sheet with a five-point clip-path and grows the triangle of the flap. Then the origin moves to the centre (at scale 1, so with no jump) and the sheet travels to the centre of the icon shrinking to 20 pixels; when it arrives, the button’s PDF comes in with back.out and the pill gives with scaleY and elastic.out.
| Name | File | Default | What it changes |
|---|---|---|---|
INVOICE | script.js | INV-2048 | The invoice number, on the card and on the sheet. |
FILE_SIZE | script.js | 84 KB | The PDF size written once it is saved. |
ACCENT | script.js | #e2552c | The colour of the stamp, the PDF tag and the icon’s band. |
BUILD_TIME | script.js | 1.4 | The seconds in which the sheet fills row by row. |
FOLD_TIME | script.js | 0.75 | The seconds in which the sheet folds into the icon and drops into the button. |
PAUSE | script.js | 1.2 | The seconds the autopilot waits between one gesture and the next. |
For the invoices page of a billing or accounting app, the customer area of a subscription service, a shop’s order receipt, any document to download as a PDF.
The card takes the full width minus the margins and the spacing tightens with vmin, so it also fits the box in height; the sheet stays 152 pixels wide and rises over the items, the button is 42 pixels tall, easy for a finger, and under 360 pixels the label tightens a little. A tap does what a click does.
No flying sheet and no springs: the arrow fades, the label becomes «Saved · 84 KB» and the check appears already drawn; the drawn pointer stays hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.4 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.