Skip to content
animorio
IT
All components

Stacked upload toast

Notifications, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.2 KBGSAP 28 KBFreeDownload the zip

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.

The code

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>

Playground

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

Or ask your AI assistant for it

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 site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a white background, at the bottom, the pile of toasts of three files uploading: brand-guidelines.pdf, homepage-v3.fig and launch-teaser.mp4, each with its drawn sheet icon and the black label of its type. They arrive one after another from below and move to the front, while the earlier ones step back ten pixels and shrink a little, their content fading: a tight pile. Each toast has a thin blue bar underneath that advances with its pauses, the percentage on the right and a line with the megabytes uploaded and the seconds left. Under the pointer the pile fans out on a spring, one toast above the other. The Figma file loses the connection at 38 per cent: the toast gives a small shake, the bar turns grey, the line says Connection lost and the Retry button takes the place of the percentage. Pressed, the bar goes back to zero and starts again. The other two finish: the percentage rises away, a blue circle swells with a check drawing itself and the bar fades. Once all three are in, the pile folds into a single toast, three overlapping sheets with a check, 3 files uploaded and View, which after a few seconds slides down and goes. A drawn pointer does it all by itself and starts again; it also really works, with mouse, touch and keyboard.

How it works

One pile, two measures

Each 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.

An upload that breathes

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.

Failing and retrying

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 and the summary

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.

The autopilot

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.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#2f6bffThe colour of the bars, the check and the summary.
PEEKscript.js10The pixels each toast behind shows above the one in front, with the pile closed.
GAPscript.js8The pixels between one toast and the next with the pile open.
SPRINGscript.js1.5How far the spring overshoots when the pile opens and closes.
SPEEDscript.js1The speed of the uploads: 2 means twice as fast.
HOLDscript.js3The seconds the summary stays before the loop starts again.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • With the pile closed, the toasts behind showed their text above the one in front and the pile looked messy: the content of anything not at the front fades, only the card’s edge stays.
  • The container is as tall as the open pile: the preview framing is measured once, at rest, and without this the open pile left the box.

Libraries

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.

Testing

Tested on 27 October 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All components