Skip to content
animorio
IT
All components

Hold to send button

Buttons, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 10 KBGSAP 28 KBFreeDownload the zip

The Send €240 button of Halden, a made-up banking app, in smoked glass on a dark desk with light and grain, like a Dribbble shot. A tap is not enough: you hold it, and a mint ring fills around Mara’s avatar while the pill trembles slightly like a phone’s haptics. Let go too soon and the ring springs back and warns you. Held to the end, the lock opens, the amount leaves the pill and flies like a spinning gold coin into the avatar, the pill says Sent to Mara, arrives instantly, and the receipt slides out from under it by a thread.

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>
<!--
  "Hold to send 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 hold to send transfer button with the flying coin</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 Send €240 button of Halden, a made-up banking app, in smoked glass on a dark desk with light and grain.
         It sends only if you hold it: a mint ring fills around the recipient's avatar while the pill trembles a
         little. Let go too soon and the ring springs back. Held to the end, the lock opens, the amount leaves the
         pill and flies like a coin into the avatar, the pill says Sent to Mara and the receipt slides out a little -->
    <div class="tx" data-wrap>
      <span class="tx__spill" data-spill aria-hidden="true"></span>

      <div class="tx__receipt" data-receipt aria-hidden="true">
        <span class="tx__receipt-paper" data-paper>
          <span class="tx__perf"></span>
          <span class="tx__line">
            <span class="tx__k">Instant transfer</span>
            <span class="tx__v">€240.00</span>
          </span>
          <span class="tx__line tx__line--muted">
            <span class="tx__k">Ref HLD 48F2 · Today 16:30</span>
            <span class="tx__v">Fee €0.00</span>
          </span>
        </span>
      </div>

      <button class="tx__btn" type="button" data-btn aria-label="Send €240 to Mara Okafor. Press and hold to confirm">
        <span class="tx__body" data-body>
          <span class="tx__fill" aria-hidden="true"></span>
          <span class="tx__charge" aria-hidden="true"><span class="tx__charge-light" data-charge></span></span>
          <span class="tx__shine" aria-hidden="true"><span class="tx__shine-light" data-shine></span></span>
          <span class="tx__sweep" aria-hidden="true"><span class="tx__sweep-band" data-sweep></span></span>
          <span class="tx__edge" aria-hidden="true"></span>
          <span class="tx__row">
            <span class="tx__who" data-who aria-hidden="true">
              <svg class="tx__ring" viewBox="0 0 56 56">
                <circle class="tx__ring-track" data-track cx="28" cy="28" r="25"/>
                <g data-mirror>
                  <circle class="tx__ring-arc" data-arc cx="28" cy="28" r="25" pathLength="1" transform="rotate(-90 28 28)"/>
                </g>
                <circle class="tx__ring-pulse" data-pulse cx="28" cy="28" r="25"/>
                <g class="tx__sparks" data-sparks>
                  <line x1="28" y1="-1" x2="28" y2="-6"/>
                  <line x1="48.5" y1="7.5" x2="52" y2="4"/>
                  <line x1="57" y1="28" x2="62" y2="28"/>
                  <line x1="48.5" y1="48.5" x2="52" y2="52"/>
                  <line x1="28" y1="57" x2="28" y2="62"/>
                  <line x1="7.5" y1="48.5" x2="4" y2="52"/>
                  <line x1="-1" y1="28" x2="-6" y2="28"/>
                  <line x1="7.5" y1="7.5" x2="4" y2="4"/>
                </g>
              </svg>
              <span class="tx__avatar" data-avatar>
                <span class="tx__avatar-face">M</span>
              </span>
            </span>
            <span class="tx__text" aria-hidden="true">
              <span class="tx__titles">
                <span class="tx__title" data-title>Send <span class="tx__amt" data-amt>€240</span></span>
                <span class="tx__title" data-title>Sent to Mara</span>
              </span>
              <span class="tx__subs">
                <span class="tx__sub" data-sub>To Mara · hold to confirm</span>
                <span class="tx__sub" data-sub>Keep holding</span>
                <span class="tx__sub tx__sub--warn" data-sub>Too soon · hold till it closes</span>
                <span class="tx__sub tx__sub--ok" data-sub>Arrives instantly · 16:30</span>
                <span class="tx__sub" data-sub>Sending to Mara</span>
              </span>
            </span>
            <span class="tx__lock" data-lockwrap aria-hidden="true">
              <svg viewBox="0 0 24 24">
                <g data-lock>
                  <path class="tx__shackle" data-shackle d="M8.4 10.6V8.2a3.6 3.6 0 0 1 7.2 0v2.4"/>
                  <rect class="tx__lock-body" x="6.2" y="10.4" width="11.6" height="8.6" rx="2.4"/>
                  <path class="tx__keyhole" d="M12 13.6v2"/>
                </g>
                <path class="tx__tick" data-tick d="M6.8 12.4l3.4 3.4 7-7.2" pathLength="1"/>
              </svg>
            </span>
          </span>
        </span>
      </button>

      <span class="tx__coin" data-coin aria-hidden="true">
        <span class="tx__coin-face" data-coinface><span>€</span></span>
      </span>

      <svg class="tx__cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true">
        <path d="M5.2 3.4l13 8.1c.6.4.4 1.3-.3 1.4l-5.3.8-2.6 4.8c-.3.6-1.2.6-1.4-.1L4 4.3c-.2-.7.6-1.3 1.2-.9z"/>
      </svg>
    </div>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

37 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 “Hold to send 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 dark desk, with a cold light behind, a mint haze rising from below and a very fine grain, a pill button 60 pixels tall in smoked glass, with a hairline edge catching the light at the top. On the left Mara’s avatar, a terracotta disc with an M, inside a ring of very thin dashes; in the middle Send €240 and under it To Mara · hold to confirm; on the right a small lock in a glass circle. Pressed, the pill sinks by a pixel and the small line says Keep holding: a mint arc starts filling the ring from the top, a mint light spreads from the avatar through the glass, the words widen slowly on the font’s width axis, the avatar grows by a hair and the pill trembles slightly, more and more as the ring closes, like a phone’s haptics; the lock’s shackle quivers too. Let go before the end and the arc springs back, swings a little past zero the other way and settles, the lock rocks and the line becomes Too soon · hold till it closes, in pink, before going back. Held to the end, the ring flashes white, the pill gives a dry thunk, the shackle lifts and the lock gives way to a drawn tick; the €240 lifts and fades and in its place a gold coin with the euro sign is born, flying along an arc above the pill, turning over and over (you see heads and tails), growing halfway and shrinking as it goes into the avatar. The avatar takes it with a bounce, a circle of light widens, eight short rays open, a reflection crosses the glass and the pill says Sent to Mara and Arrives instantly · 16:30. From under the pill the paper receipt with its perforated edge slides out by a thread, on a spring: Instant transfer €240.00, Ref HLD 48F2 · Today 16:30, Fee €0.00. After a few seconds the receipt goes back in and the button returns as it was, with the amount dropping back into place. Until someone touches it, a drawn pointer tries once too soon and then holds to the end.

How it works

Glass in layers

The pill is a single box (moved only by GSAP) with absolute layers: the smoked glass with a gradient from the top, the radial mint light anchored to the avatar that grows with the press, the light under the pointer driven by two CSS variables through gsap.quickTo, the reflection band and on top the inner shadows of the edge. Under the pill, in a clipping box, the receipt waits moved up by 62 pixels, hidden behind the glass.

A ring that goes below zero

A single number P.p goes from 0 to 1 while you hold, with a gsap.ticker adding the elapsed time divided by HOLD_TIME. The arc is a circle with pathLength 1 and its strokeDasharray is the length. Released early, P.p goes back to 0 with an elastic.out and dips below zero: for negative values the arc’s group is mirrored with a matrix and the dash is drawn the other way, so the spring really shows.

The fake haptics

In the same ticker the pill moves by fractions of a pixel and turns by hundredths of a degree, summing three fast sines with different frequencies, never a loop that repeats; the amplitude grows with the ring and with SHAKE. The lock’s shackle quivers on a slower sine. At the end the tremble stops with a dry thunk: scale 0.975 for a tenth of a second and back on a spring.

The coin on a curve

The coin lives outside the pill (which clips) and moves on a quadratic Bézier curve: starting at the centre of the amount, ending at the centre of the avatar, the control point above the pill. Positions are read again with getBoundingClientRect at every frame, so even if the window changes size mid-flight the coin lands right. The spin is scaleX = cosine of time: when it is negative the face switches to the darker tails side.

Going round by itself

A timeline brings a drawn pointer onto the pill, presses for a little more than half the time and lets go (the spring and the warning), then holds to the end and leaves. The loop starts from the load event, so poster and video always land on the same moment; at the first real touch it stops and the pill answers only to hands: pointerdown with setPointerCapture, pointerup and pointercancel let go, Space and Enter held do the same from the keyboard.

Values to change

NameFileDefaultWhat it changes
AMOUNTscript.js€240The amount on the button, the one that flies.
NAMEscript.jsMaraWho receives the money.
HOLD_TIMEscript.js1.4How many seconds you have to hold before it sends.
SHAKEscript.js1How much the pill trembles while you hold it: 0 still, 2 strong.
FLIGHTscript.js0.95How many seconds the coin flies to the avatar.
FLIPSscript.js2.5How many times the coin turns during the flight.
SPRINGscript.js1How springy the moves are: 0.4 calm, 2 very bouncy.
SHOWscript.js3How many seconds it stays on Sent with the receipt out before going back.
AUTOscript.jstrueThe drawn pointer goes round by itself until someone touches the button.

Try them in the Playground

When to use it

For a banking or payments app, a digital wallet, an instant transfer, a payment between friends or settling a split bill: every action that moves real money and must not go off with a wrong tap. Holding is the confirmation, the ring says how much is left and the receipt that slides out says it is done.

On phones

On the phone the pill takes the full width minus the margins and long words end with an ellipsis; the finger holds just like the mouse (the long press menu is off), the coin flies a lower arc because the way is shorter and the receipt slides out the same.

With reduced motion

Nothing moves: the ring still fills (it shows how much is left) without trembling, released early it empties without a spring, the amount fades, the tick and the new words fade in and the receipt appears already in place.

Pitfalls

  • The spring of the ring released early did not show: an arc with a negative length is not drawn, so the swing past zero vanished. For negative values the arc’s group is mirrored and the dash runs the other way.
  • The coin inside the pill was clipped by its rounded edge: it lives outside, in the wrapper, and its path is read again at every frame from the rectangles of the amount and the avatar.
  • On the phone the long press opened the system menu and selected the words: touch-action none, user-select none, -webkit-touch-callout none and contextmenu cancelled on the button.
  • Moving the finger off the pill, pointerup never came and the ring stayed half full: setPointerCapture at the start and lostpointercapture among the events that let go.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 10 KB; the libraries: GSAP 28 KB.

Testing

Tested on 4 November 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