
The elastic button
Buttons, Hover, Text
The Share button at the end of an article, with one gesture: pressed, the dark pill widens on a spring into a row of four line icons (copy link, email, message, embed code) that come in one after another. On hover each icon lifts and shows its name; Copy link turns into a check and “Link copied” slides in under the card. The cross folds the row back into the button.
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>
<!--
"Share row 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 share button that opens into a row</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">
<!-- one gesture: press. The end of an article with a dark Share pill: pressed, it widens on a spring into a row of
four drawn icons (copy link, email, message, embed) that come in one after another; Copy link turns into a
check and a small note says the link is copied; the close button folds the row back into Share -->
<article class="card" data-card aria-label="Article footer">
<p class="card__eyebrow">Kettlefield Journal</p>
<h1 class="card__title">How we rebuilt checkout in six weeks</h1>
<p class="card__meta"><span>Oct 24</span><span class="sep" aria-hidden="true"></span><span>6 min read</span></p>
<div class="card__foot">
<div class="byline">
<span class="byline__face" aria-hidden="true">MQ</span>
<span class="byline__text"><b>Mara Quist</b><span>Design lead</span></span>
</div>
<div class="share" data-share>
<span class="share__fill" aria-hidden="true"></span>
<button class="share__main" type="button" data-open aria-expanded="false" aria-controls="share-row">
<svg class="ico" viewBox="0 0 24 24" aria-hidden="true">
<path d="M12 14.5V3.8"></path>
<path d="M8.2 7.4 12 3.6l3.8 3.8"></path>
<path d="M8.5 10.5H7a2 2 0 0 0-2 2V18a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-5.5a2 2 0 0 0-2-2h-1.5"></path>
</svg>
<span class="share__label" data-label>Share</span>
</button>
<div class="share__row" id="share-row" data-row role="group" aria-label="Share this article">
<button class="act" type="button" data-act="link" aria-label="Copy link">
<span class="tip" aria-hidden="true">Copy link</span>
<svg class="ico" viewBox="0 0 24 24" aria-hidden="true">
<g class="i-link">
<path d="M10.2 13.8a3.6 3.6 0 0 0 5.1 0l3-3a3.6 3.6 0 0 0-5.1-5.1l-1.1 1.1"></path>
<path d="M13.8 10.2a3.6 3.6 0 0 0-5.1 0l-3 3a3.6 3.6 0 0 0 5.1 5.1l1.1-1.1"></path>
</g>
<path class="i-check" d="M5.6 12.6l4 3.9 8.8-9"></path>
</svg>
</button>
<button class="act" type="button" data-act="mail" aria-label="Email">
<span class="tip" aria-hidden="true">Email</span>
<svg class="ico" viewBox="0 0 24 24" aria-hidden="true">
<rect x="3.5" y="5.5" width="17" height="13" rx="2.5"></rect>
<path d="m4.5 7.2 7.5 5.6 7.5-5.6"></path>
</svg>
</button>
<button class="act" type="button" data-act="message" aria-label="Message">
<span class="tip" aria-hidden="true">Message</span>
<svg class="ico" viewBox="0 0 24 24" aria-hidden="true">
<path d="M5 5.5h14a1.5 1.5 0 0 1 1.5 1.5v8.5A1.5 1.5 0 0 1 19 17h-7.4L7 20.4V17H5a1.5 1.5 0 0 1-1.5-1.5V7A1.5 1.5 0 0 1 5 5.5Z"></path>
<path d="M8 10h8M8 13h5"></path>
</svg>
</button>
<button class="act" type="button" data-act="embed" aria-label="Copy embed code">
<span class="tip" aria-hidden="true">Embed</span>
<svg class="ico" viewBox="0 0 24 24" aria-hidden="true">
<path d="m8.5 7.5-4.5 4.5 4.5 4.5"></path>
<path d="m15.5 7.5 4.5 4.5-4.5 4.5"></path>
<path d="m13.4 5.6-2.8 12.8"></path>
</svg>
</button>
<span class="row__sep" aria-hidden="true"></span>
<button class="act act--close" type="button" data-close aria-label="Close">
<svg class="ico" viewBox="0 0 24 24" aria-hidden="true">
<path d="M7 7l10 10M17 7 7 17"></path>
</svg>
</button>
</div>
</div>
</div>
<div class="toast" data-toast role="status" aria-live="polite">
<svg class="toast__ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M5.6 12.6l4 3.9 8.8-9"></path></svg>
<span class="toast__text" data-toast-text>Link copied</span>
<span class="toast__url" data-toast-url>kettlefield.co/j/checkout</span>
</div>
</article>
<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.
30 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 “Share row button” from Animorio and fit it into my siteThe same pill holds the Share button and the row of icons, both absolutely positioned; GSAP only changes the pill’s width, measured on the real word (scrollWidth) when closed and on the whole row when open, with back.out for the short bounce.
The icons start 8 pixels lower, at 60% size and transparent, and reach their place with back.out(2.2), 50 milliseconds apart; on closing they leave the other way round, last to first, before the pill narrows.
On hover the icon (not the button) rises by 2 pixels and the bubble above fades in rising by 4: the button stays put, so the light circle behind does not move and the click never misses.
Copy link writes the address to the clipboard with navigator.clipboard, when the browser allows it; the chain turns and vanishes, the check draws itself with stroke-dashoffset and after 1.8 seconds the chain is back. Embed copies an iframe snippet.
Before opening, the script checks whether the open row would cover the author’s name; if so, the name fades out and comes back when the row folds. The same check runs again when the window changes.
| Name | File | Default | What it changes |
|---|---|---|---|
LABEL | script.js | Share | The label of the closed button. |
LINK | script.js | kettlefield.co/j/checkout | The link Copy link puts on the clipboard. |
SPRING | script.js | 0.6 | How long the spring that opens and folds the row lasts, in seconds. |
STAGGER | script.js | 0.05 | The delay between one icon and the next as they come in, in seconds. |
SQUEEZE | script.js | 0.94 | How much the button squeezes when pressed (1 = not at all). |
AUTO_CLOSE | script.js | 2.4 | After how many seconds the row folds by itself after a choice (0 = never). |
ACCENT | script.js | #6d5efc | The colour of the focus ring and the line above the headline. |
At the end of a blog or magazine article, on a portfolio project page, under a product or an event worth passing on: a single button that takes no room until it is needed.
The same card narrowed to the box: the open row covers the author’s name, which steps aside; a finger presses like the mouse and, since there is no hover, the bubbles appear only with keyboard focus.
No springs, squeezes or jumps: the pill changes width in a moment, the icons, the bubbles and the pill under the card simply fade in.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.9 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.