
The elastic button
Buttons, Hover, Text
The toolbar of an invoices table, on white, with a split Export CSV button and its little arrow. The arrow opens the formats, CSV, XLSX, PDF and JSON, with file icons and an estimated size, and a grey bar slides under the hovered option; once a format is picked, only the letters that change roll in the label. Pressed, the button becomes its own progress bar with the percentage, then green with Downloaded, a check drawing itself and a small file falling out.
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>
<!--
"Export format 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 export button with a format picker</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">
<!-- the toolbar of a table, on white: a split Export button. The arrow opens the formats, the choice rolls into the
label, and a press turns the button into its own progress bar, then into Downloaded with a file dropping out -->
<section class="card" data-card aria-label="Invoices table">
<header class="bar">
<div class="bar__title">
<p class="bar__name">Invoices</p>
<p class="bar__meta"><span class="num">248</span> rows <span class="bar__sep">·</span> Q3 2026</p>
</div>
<div class="split" data-split>
<button class="split__main" type="button" data-main aria-live="polite">
<span class="split__fill" data-fill aria-hidden="true"></span>
<span class="split__in">
<svg class="split__icon" data-icon viewBox="0 0 20 20" aria-hidden="true"><path d="M10 3.5v9M6.2 9 10 12.8 13.8 9M4 15.5h12"></path></svg>
<svg class="split__check" data-check viewBox="0 0 20 20" aria-hidden="true"><path d="M4.6 10.4 8.3 14l7.1-8" pathLength="1"></path></svg>
<span class="split__label" data-label></span>
<span class="split__pct num" data-pct></span>
</span>
</button>
<button class="split__more" type="button" data-more aria-haspopup="listbox" aria-expanded="false" aria-label="Choose a format">
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M6 8.2 10 12l4-3.8"></path></svg>
</button>
<svg class="drop" data-drop viewBox="0 0 24 28" aria-hidden="true"><path d="M5 2.5h9.5L20 8v16.5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-21a1 1 0 0 1 1-1Z"></path><path d="M14.5 2.5V8H20"></path></svg>
<div class="menu" data-menu role="listbox" aria-label="Export format">
<span class="menu__hl" data-hl aria-hidden="true"></span>
</div>
</div>
</header>
<div class="rows" aria-hidden="true">
<div class="row"><span class="num">INV-2041</span><span>Harrow & Pike</span><span class="row__tag">Paid</span><span class="num row__amt">$1,840.00</span></div>
<div class="row"><span class="num">INV-2040</span><span>Oakfield Supply</span><span class="row__tag">Due</span><span class="num row__amt">$620.50</span></div>
<div class="row"><span class="num">INV-2039</span><span>Mirelle Studio</span><span class="row__tag">Paid</span><span class="num row__amt">$3,215.00</span></div>
<div class="row"><span class="num">INV-2038</span><span>Brisk Lane Freight</span><span class="row__tag">Draft</span><span class="num row__amt">$905.75</span></div>
</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>
<span class="measure" data-measure aria-hidden="true"></span>
</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.
38 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 “Export format button” from Animorio and fit it into my siteThe button is two buttons side by side with one pixel between them: the wide one exports, the narrow one opens the menu and carries aria-expanded. The outer corners are round and the inner ones square, so from a distance it reads as a single piece.
The options are built from a list of formats. A single grey bar sits behind them and GSAP takes it to the offsetTop of the option under the pointer in 0.28 seconds with power3.out: it does not light one option at a time, it slides. The menu opens with back.out from 0.96 and the options come in 3 hundredths apart.
The label is a group of spans, one per letter. When it changes, the letters shared at the start (Export and the space) stay put, and only the others leave upwards and come back from below 16 milliseconds apart. The width is measured on a hidden span and the button gets there with back.out.
The fill is a span behind the label with its transform-origin on the left; an object p goes from 0 to 1 in three timeline legs (fast, almost still, fast) and on each update writes scaleX and the percentage. At the end the background turns green with a colour tween and the check, with pathLength 1, draws itself.
The file is a small SVG under the button that drops a few pixels, appears, then falls and tilts as it fades, with GSAP keyframes. The autopilot is a timeline that opens the menu, goes down option by option to the next format, picks it and exports; the first real gesture stops it.
| Name | File | Default | What it changes |
|---|---|---|---|
START_FORMAT | script.js | "CSV" | The format chosen at the start: CSV, XLSX, PDF or JSON. |
EXPORT_TIME | script.js | 1.8 | The seconds the file takes to get ready. |
DONE_HOLD | script.js | 1.6 | The seconds it stays green with Downloaded before going back. |
SPRING | script.js | 1 | How much the button’s width bounces when it changes (0 = none). |
MENU_SPEED | script.js | 1 | How quickly the format menu opens and closes. |
LETTER_STAGGER | script.js | 0.016 | The seconds between one letter and the next as the label rolls. |
For the toolbar of a table or a report in a back office, a dashboard or a team app: picking the format and downloading live in the same button, and whoever waits sees how far along it is without another window.
The same animation: the card narrows to the screen width, the status column hides and the menu stays inside the box; a tap does the hover, the choice and the download.
No rolling letters and no spring: labels change with a fade, the menu appears without moving, the fill fades in instead of stretching, the check is already drawn and the file does not fall.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.7 KB; the libraries: GSAP 28 KB.
Tested on 25 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.