
The star rating
Ratings, SVG, Hover
Someone searched for “undo send” and the library returned things that had nothing to do with it. The Send button of a mail app, black on white, with a drawn paper plane: on click the plane takes off along a curve leaving a thin blue trail that fades, and the pill widens on a spring into Undo, with a thin ring running out over five seconds and a rolling number. Press Undo and the plane flies back the same way and slips into the pill, which turns back into Send with a small bounce; if time runs out the pill turns blue, the tick draws itself and it says Sent, then goes back to Send. Below, a rolling line says what is happening: the draft, sending in how many seconds, back in your drafts, sent.
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>
<!--
"Undo 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>Undo send button</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 button of a made-up mail app: the paper plane takes off, the pill becomes Undo with a ring that
runs out in five seconds; Undo brings the plane back, time out turns it into Sent -->
<div class="wrap" data-wrap>
<div class="fly" aria-hidden="true">
<svg class="trail" data-trail-svg><path class="trail__path" data-trail pathLength="1"></path></svg>
<span class="plane plane--fly" data-plane>
<svg viewBox="0 0 24 24"><path class="plane__body" d="M3.4 11.2 20.6 3.6 15 20.4l-3.6-6.9z"></path><path class="plane__fold" d="M11.4 13.5 20.6 3.6"></path></svg>
</span>
</div>
<button class="pill" type="button" data-pill aria-label="Send">
<span class="pill__lift" data-lift>
<span class="pill__bg" data-bg></span>
<span class="pill__sheen" aria-hidden="true"></span>
<span class="face face--send" data-face="send">
<span class="face__label">Send</span>
<span class="plane plane--home" data-home aria-hidden="true">
<svg viewBox="0 0 24 24"><path class="plane__body" d="M3.4 11.2 20.6 3.6 15 20.4l-3.6-6.9z"></path><path class="plane__fold" d="M11.4 13.5 20.6 3.6"></path></svg>
</span>
</span>
<span class="face face--undo" data-face="undo" aria-hidden="true">
<svg class="ring" viewBox="0 0 20 20">
<circle class="ring__track" cx="10" cy="10" r="8"></circle>
<circle class="ring__left" cx="10" cy="10" r="8" pathLength="1" transform="rotate(-90 10 10)" data-ring></circle>
</svg>
<span class="face__label">Undo</span>
<span class="count" data-count><span class="count__n">5</span></span>
</span>
<span class="face face--sent" data-face="sent" aria-hidden="true">
<svg class="tick" viewBox="0 0 20 20"><path d="M4.6 10.4 8.3 14 15.6 6.4" pathLength="1" data-tick></path></svg>
<span class="face__label">Sent</span>
</span>
</span>
</button>
<p class="note" aria-live="polite"><span class="note__line" data-note>Draft to Ada Lind</span></p>
</div>
</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.
19 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Undo send button” from Animorio and fit it into my siteInside the pill sit three stacked faces, Send, Undo and Sent, each a flex row with its own padding. The script measures them one by one with getBoundingClientRect and takes the pill’s width to the face it shows, with back.out for the spring; the sizes are taken again on resize and once the font has arrived.
The flying plane is a copy outside the pill, in a layer over the button that clips nothing. The path is a quadratic curve from the plane’s place in the pill to a point up and to the right; a single number from 0 to 1 says where it is, and on every frame the script works out the point, the direction (the curve’s derivative) and the scale.
The trail is the same curve written in a path with pathLength 1: its stroke-dashoffset is 1 minus the flight number, so it draws exactly behind the plane, and it dies away in the last part of the flight.
Undo stops the count and takes the same number back to 0 from wherever it was: the plane retraces the curve, even if stopped mid-flight. Just before it arrives the pill narrows on its spring, so the plane slips into a pill that is already the right size.
A five second linear tween drives the ring (stroke-dashoffset from 0 to 1 on a circle turned by -90 degrees, so it starts at twelve o’clock) and, whenever the whole second changes, rolls the number and the line below. At the end it calls Sent.
| Name | File | Default | What it changes |
|---|---|---|---|
RECIPIENT | script.js | Ada Lind | Who the email goes to, written in the line under the button. |
UNDO_TIME | script.js | 5 | The seconds to undo the send: how long the ring takes to run out. |
FLIGHT_TIME | script.js | 0.9 | How long the plane flies when it takes off, in seconds. |
FLIGHT_HEIGHT | script.js | 96 | How high the plane climbs above the button, in pixels. |
SPRING | script.js | 1.8 | How far the pill overshoots when it changes width (0 = no bounce). |
SENT_HOLD | script.js | 1.8 | How long «Sent» stays before going back to Send, in seconds. |
LOOP_PAUSE | script.js | 1.4 | The pause of the self-running tour between one send and the next, in seconds. |
On the send button of a mail app, a chat, a contact form or a newsletter, wherever sending something by mistake is costly and a few seconds to think again help.
The pill drops to 52 pixels and the flight shortens to the room left on the right and above: the plane never leaves the box. A tap does the press, and there is no hover.
No flight, no springs and no rolling: the faces crossfade, the width jumps to the new size, the ring still runs out and the number changes in place. The self-running tour does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.2 KB; the libraries: GSAP 28 KB.
Tested on 23 November 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.
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.