Skip to content
animorio
IT
All components

Download invoice button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.4 KBGSAP 28 KBFreeDownload the zip

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.

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>
<!--
  "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 &amp; 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 &amp; 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>

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.

47 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 “Download invoice button” 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 very light grey background sits the white invoice card of Ledgerbird, an invented billing app: the black mark, the grey Paid label, the number INV-2048, the client Maple & Finch Studio, the large amount $1,284.00, the dates and three line items. At the bottom, the black «Download invoice» pill with an arrow dropping into a tray, and «PDF · A4» beside it. On hover the arrow dips two pixels and springs back. Pressed, the button squashes and returns, the arrow falls into the tray and disappears, a thin ring fills in its place while the pill lights up from left to right and the label becomes «Generating PDF», the pill tightening around the new words on a spring. Meanwhile the card dims and the invoice sheet rises out of the button, turning slightly: first the rows are grey bars, then the words wipe in from the left and the amounts rise one after another, the total rule draws itself, the total lands with a small press and the orange Paid stamp drops crooked onto the sheet, which jolts a pixel. Then the top right corner folds, the PDF tag slides in from the left and the sheet shrinks and turns until it becomes the document icon, which drops into the button: the pill gives under the hit and settles with an elastic. The icon gives way to a drawn check, the label becomes «Saved · 84 KB» and the file name appears beside it. Pressing again brings everything back, the arrow coming in from above.

How it works

One button, four icons

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

The pill tightening around the label

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 coming out of the button

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.

The rows filling in

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 fold and the fall into the icon

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.

Values to change

NameFileDefaultWhat it changes
INVOICEscript.jsINV-2048The invoice number, on the card and on the sheet.
FILE_SIZEscript.js84 KBThe PDF size written once it is saved.
ACCENTscript.js#e2552cThe colour of the stamp, the PDF tag and the icon’s band.
BUILD_TIMEscript.js1.4The seconds in which the sheet fills row by row.
FOLD_TIMEscript.js0.75The seconds in which the sheet folds into the icon and drops into the button.
PAUSEscript.js1.2The seconds the autopilot waits between one gesture and the next.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • Changing the transform origin mid-flight makes the sheet jump: change it only when the scale is 1, that is when the sheet rests in its place.
  • The pill’s width must go back to auto at the end of the tween, otherwise a window resize or a late font cuts the label.
  • The words’ clip-path inset must be written with percentages on all four sides, at the start and at the end, so GSAP interpolates it instead of jumping.

Libraries

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.

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