
The elastic button
Buttons, Hover, Text
The toasts of three files uploading, on white, in the style of product interface pieces: they sit in a tight pile and fan out on a spring under the pointer. Each has its own bar, percentage and seconds left; one loses the connection and offers Retry, the others finish with a check, and in the end the pile folds into a single toast, 3 files uploaded.
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>
<!--
"Stacked upload toast" 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 upload toast that stacks</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>
<!-- three upload toasts that stack into a tight pile: hovering fans them out on a spring, each has its own bar,
percentage and time left, one fails and offers Retry, and once all are in they fold into a single summary toast -->
<section class="wrap" data-wrap aria-label="Uploads">
<ol class="pile" data-pile aria-live="polite">
<li class="toast" data-toast data-name="brand-guidelines.pdf" data-size="6.1" data-secs="4" data-tag="PDF">
<div class="toast__in">
<span class="file" aria-hidden="true">
<svg viewBox="0 0 32 40"><path class="file__sheet" d="M5 2h15l7 7v27a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Z"></path><path class="file__fold" d="M20 2v7h7"></path><path class="file__line" d="M8 19h12M8 24h15M8 29h9"></path></svg>
<b class="file__tag">PDF</b>
</span>
<div class="toast__text">
<p class="toast__name">brand-guidelines.pdf</p>
<p class="toast__meta" data-meta>Waiting</p>
</div>
<div class="toast__end">
<span class="toast__pct" data-pct>0%</span>
<svg class="toast__check" data-check viewBox="0 0 20 20" aria-hidden="true"><circle cx="10" cy="10" r="9"></circle><path d="m6 10.4 2.7 2.6L14.2 7.4"></path></svg>
<button class="retry" type="button" data-retry tabindex="-1">Retry</button>
</div>
</div>
<div class="bar"><i data-bar></i></div>
</li>
<li class="toast" data-toast data-name="homepage-v3.fig" data-size="14.8" data-secs="6" data-tag="FIG" data-fails="38">
<div class="toast__in">
<span class="file" aria-hidden="true">
<svg viewBox="0 0 32 40"><path class="file__sheet" d="M5 2h15l7 7v27a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Z"></path><path class="file__fold" d="M20 2v7h7"></path><path class="file__line" d="M8 18h7v7H8zM17 22a3.5 3.5 0 1 0 0 .1M8 29h15"></path></svg>
<b class="file__tag">FIG</b>
</span>
<div class="toast__text">
<p class="toast__name">homepage-v3.fig</p>
<p class="toast__meta" data-meta>Waiting</p>
</div>
<div class="toast__end">
<span class="toast__pct" data-pct>0%</span>
<svg class="toast__check" data-check viewBox="0 0 20 20" aria-hidden="true"><circle cx="10" cy="10" r="9"></circle><path d="m6 10.4 2.7 2.6L14.2 7.4"></path></svg>
<button class="retry" type="button" data-retry tabindex="-1">Retry</button>
</div>
</div>
<div class="bar"><i data-bar></i></div>
</li>
<li class="toast" data-toast data-name="launch-teaser.mp4" data-size="42.3" data-secs="7.6" data-tag="MP4">
<div class="toast__in">
<span class="file" aria-hidden="true">
<svg viewBox="0 0 32 40"><path class="file__sheet" d="M5 2h15l7 7v27a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Z"></path><path class="file__fold" d="M20 2v7h7"></path><path class="file__line" d="M12 19v9l7-4.5Z"></path></svg>
<b class="file__tag">MP4</b>
</span>
<div class="toast__text">
<p class="toast__name">launch-teaser.mp4</p>
<p class="toast__meta" data-meta>Waiting</p>
</div>
<div class="toast__end">
<span class="toast__pct" data-pct>0%</span>
<svg class="toast__check" data-check viewBox="0 0 20 20" aria-hidden="true"><circle cx="10" cy="10" r="9"></circle><path d="m6 10.4 2.7 2.6L14.2 7.4"></path></svg>
<button class="retry" type="button" data-retry tabindex="-1">Retry</button>
</div>
</div>
<div class="bar"><i data-bar></i></div>
</li>
<li class="toast toast--sum" data-sum>
<div class="toast__in">
<span class="sum__files" aria-hidden="true">
<svg viewBox="0 0 32 40"><path class="file__sheet" d="M5 2h15l7 7v27a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Z"></path><path class="file__fold" d="M20 2v7h7"></path></svg>
<svg viewBox="0 0 32 40"><path class="file__sheet" d="M5 2h15l7 7v27a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Z"></path><path class="file__fold" d="M20 2v7h7"></path></svg>
<svg viewBox="0 0 32 40"><path class="file__sheet" d="M5 2h15l7 7v27a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Z"></path><path class="file__fold" d="M20 2v7h7"></path><path class="sum__tick" d="m10 22 4 4 8-9"></path></svg>
</span>
<div class="toast__text">
<p class="toast__name">3 files uploaded</p>
<p class="toast__meta">63.2 MB to Shared / Launch</p>
</div>
<div class="toast__end">
<button class="view" type="button" tabindex="-1">View</button>
</div>
</div>
</li>
</ol>
</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.
34 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 “Stacked upload toast” from Animorio and fit it into my siteEach toast is absolute at the bottom of the container. Its place in the pile counts from the front: with the pile closed it rises ten pixels per place and shrinks five per cent, with the pile open it rises a full height plus eight pixels. A single tween with back.out takes each toast to its new measure, so opening, closing and adding are the same function.
The percentage is a number animated by GSAP with four keyframes, fast, almost still, fast again and slower at the end, because a real upload never runs straight. On every frame it widens the bar with scaleX and rewrites the percentage, the megabytes and the seconds left.
The file that fails has a stopping point in its keyframes: there the bar turns grey, the toast shakes three pixels and the Retry button springs in where the percentage was. On retry the bar goes back to zero in a third of a second and the upload starts again with no stop.
The check is a circle that swells with back.out and a stroke drawn with strokeDashoffset. When all three are done, the toasts drop to zero and fade, and in their place grows a single toast with three sheets arriving staggered.
A timeline with repeatRefresh starts the uploads, takes the drawn pointer to the pile and to Retry reading their real position each time, and calls the same functions as the mouse. At the first real gesture it steps aside, and if the file is not retried it waits before the summary; it starts again from the top after eight quiet seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #2f6bff | The colour of the bars, the check and the summary. |
PEEK | script.js | 10 | The pixels each toast behind shows above the one in front, with the pile closed. |
GAP | script.js | 8 | The pixels between one toast and the next with the pile open. |
SPRING | script.js | 1.5 | How far the spring overshoots when the pile opens and closes. |
SPEED | script.js | 1 | The speed of the uploads: 2 means twice as fast. |
HOLD | script.js | 3 | The seconds the summary stays before the loop starts again. |
For an app that uploads files, a dashboard with attachments, an editor saving to the cloud, an asset manager for a team, anywhere several uploads start together and need to be seen without covering the page.
The pile takes the full width minus the margins, up to 340 pixels; under 380 pixels the text tightens a little. On a phone there is no hover: a tap on the pile opens and closes it, and Retry is pressed with a finger.
The pile stays open and still, the toasts appear and disappear with fades, no shakes and no springs, the check appears without drawing and the drawn pointer stays hidden. The bars still advance.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.2 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.