Skip to content
animorio
IT
All components

Share row button

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

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.

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>
<!--
  "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>

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.

30 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 “Share row 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 white background sits the end of a made-up article, “How we rebuilt checkout in six weeks” from the Kettlefield Journal: the violet line above the headline, the date and reading time split by a thin upright line, then, under a rule, the author with her initials in a lilac circle and on the right a black pill with the share icon and the word Share. On hover the pill lifts by a pixel; pressed, it squeezes and comes back on an elastic spring. The icon and the word rise and vanish, and the pill widens to the left with a short bounce into a row: four line icons, copy link, email, message and embed code, that come in one after another growing from below, a thin divider and the cross to close. If there is no room, the author’s name steps aside with a fade. Hover an icon and it lifts by two pixels, a faint light circle comes up behind it and its name appears above in a dark bubble with a tip. Press Copy link and the chain turns and vanishes while a green check draws itself in its place, the bubble says Copied, and under the card a white pill rises with a check, “Link copied” and the address in grey, then leaves upwards a moment later. Embed really copies the embed code, email and message say what would happen. The cross folds the row back: the icons leave from the last to the first, the pill narrows again and Share comes back from below. A drawn pointer shows the whole loop on its own.

How it works

One pill, two contents

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

Icons coming in staggered

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.

The bubble and the lift

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.

Really copied

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.

The name steps aside

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.

Values to change

NameFileDefaultWhat it changes
LABELscript.jsShareThe label of the closed button.
LINKscript.jskettlefield.co/j/checkoutThe link Copy link puts on the clipboard.
SPRINGscript.js0.6How long the spring that opens and folds the row lasts, in seconds.
STAGGERscript.js0.05The delay between one icon and the next as they come in, in seconds.
SQUEEZEscript.js0.94How much the button squeezes when pressed (1 = not at all).
AUTO_CLOSEscript.js2.4After how many seconds the row folds by itself after a choice (0 = never).
ACCENTscript.js#6d5efcThe colour of the focus ring and the line above the headline.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • Measure the width on the real words and icons, and again once the typeface has arrived: measured earlier, the pill stays narrow and cuts Share.
  • The bubble is centred with GSAP’s xPercent, not with CSS translate: GSAP’s inline transform would wipe the class’s translate and the bubble would slide sideways.
  • navigator.clipboard only works on a secure page and after a real gesture: during the autopilot it may copy nothing, and the piece must not stop because of it.

Libraries

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.

Testing

Tested on 25 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