
The elastic button
Buttons, Hover, Text
The form to cancel the subscription of an invented sleep app, honest and product-grade, in a white card on white: first the reason, six pills that light up on a spring with a check that draws itself, and the Anything else? field that opens only with Other; then what you lose, three lines struck out one after the other by a red thread, and an offer that fits the reason lifting like a card with a light running round its edge; Pause and Cancel plan give under the finger and at the end the date the plan ends is written letter by letter.
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>
<!--
"Cancellation form" 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 cancellation form with the reason and the offer</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" data-stage>
<!-- the cancellation form of an invented sleep and focus app: the reason first, then what you lose and an offer
that fits the reason, then the date the plan ends (or the pause) written out -->
<section class="cx" data-cx aria-label="Cancel your plan">
<header class="cx__head">
<span class="app">
<svg class="app__mark" viewBox="0 0 20 20" aria-hidden="true"><path d="M3 12.5c2.2-3.6 4.6-3.6 7 0s4.8 3.6 7 0"></path><path d="M3 7.5c2.2-3.6 4.6-3.6 7 0s4.8 3.6 7 0"></path></svg>
<span class="app__name" data-brand>Tidewell</span>
<span class="app__plan">Plus</span>
</span>
<span class="cx__price" data-price>$9.99 / month</span>
</header>
<div class="views" data-views>
<!-- the reason -->
<div class="view is-on" data-view="why">
<h1 class="title">Why are you leaving?</h1>
<p class="sub">One tap is enough. It helps us make Tidewell better.</p>
<div class="reasons" role="radiogroup" aria-label="Reason" data-reasons>
<button class="pill" type="button" role="radio" aria-checked="false" data-reason="price"><span class="pill__fill" aria-hidden="true"></span><span class="pill__in"><span class="pill__tick" aria-hidden="true"><svg viewBox="0 0 16 16"><path pathLength="1" d="M3.6 8.4l2.9 2.9 5.9-6.4"></path></svg></span><span class="pill__words">Too expensive</span></span></button>
<button class="pill" type="button" role="radio" aria-checked="false" data-reason="use"><span class="pill__fill" aria-hidden="true"></span><span class="pill__in"><span class="pill__tick" aria-hidden="true"><svg viewBox="0 0 16 16"><path pathLength="1" d="M3.6 8.4l2.9 2.9 5.9-6.4"></path></svg></span><span class="pill__words">Not using it</span></span></button>
<button class="pill" type="button" role="radio" aria-checked="false" data-reason="switch"><span class="pill__fill" aria-hidden="true"></span><span class="pill__in"><span class="pill__tick" aria-hidden="true"><svg viewBox="0 0 16 16"><path pathLength="1" d="M3.6 8.4l2.9 2.9 5.9-6.4"></path></svg></span><span class="pill__words">Found another app</span></span></button>
<button class="pill" type="button" role="radio" aria-checked="false" data-reason="feature"><span class="pill__fill" aria-hidden="true"></span><span class="pill__in"><span class="pill__tick" aria-hidden="true"><svg viewBox="0 0 16 16"><path pathLength="1" d="M3.6 8.4l2.9 2.9 5.9-6.4"></path></svg></span><span class="pill__words">Missing features</span></span></button>
<button class="pill" type="button" role="radio" aria-checked="false" data-reason="bugs"><span class="pill__fill" aria-hidden="true"></span><span class="pill__in"><span class="pill__tick" aria-hidden="true"><svg viewBox="0 0 16 16"><path pathLength="1" d="M3.6 8.4l2.9 2.9 5.9-6.4"></path></svg></span><span class="pill__words">Bugs and issues</span></span></button>
<button class="pill" type="button" role="radio" aria-checked="false" data-reason="other"><span class="pill__fill" aria-hidden="true"></span><span class="pill__in"><span class="pill__tick" aria-hidden="true"><svg viewBox="0 0 16 16"><path pathLength="1" d="M3.6 8.4l2.9 2.9 5.9-6.4"></path></svg></span><span class="pill__words">Other</span></span></button>
</div>
<div class="more" data-more>
<label class="more__box">
<span class="more__label">Anything else?</span>
<textarea class="more__text" data-text rows="2" maxlength="140" placeholder="Tell us in a few words" aria-label="Anything else?"></textarea>
<span class="more__count" data-count>0 / 140</span>
</label>
</div>
<button class="next" type="button" data-next disabled>
<span class="next__words">Continue</span>
<svg class="next__icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9M8.6 4.4 12.2 8l-3.6 3.6"></path></svg>
</button>
</div>
<!-- what you lose and the offer -->
<div class="view" data-view="lose" aria-hidden="true">
<button class="back" type="button" data-back>
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M9.8 4 5.8 8l4 4"></path></svg>
<span>Back</span>
</button>
<h2 class="title">If you cancel, you lose</h2>
<ul class="losses" data-losses>
<li class="loss"><svg class="loss__icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M5.5 3.5h9v13l-4.5-3-4.5 3z"></path></svg><span class="loss__words"><span>312 saved sessions</span><i class="loss__strike" aria-hidden="true"></i></span></li>
<li class="loss"><svg class="loss__icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M10 3.5v9M6.2 9l3.8 3.8L13.8 9M4 16.5h12"></path></svg><span class="loss__words"><span>Offline downloads</span><i class="loss__strike" aria-hidden="true"></i></span></li>
<li class="loss"><svg class="loss__icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M3.5 13.5l4-4 3 3 6-6M12.5 6.5h4v4"></path></svg><span class="loss__words"><span>Your 46-night sleep streak</span><i class="loss__strike" aria-hidden="true"></i></span></li>
</ul>
<div class="offer" data-offer>
<span class="offer__edge" aria-hidden="true"></span>
<span class="offer__glow" data-glow aria-hidden="true"></span>
<span class="offer__icon" aria-hidden="true">
<svg viewBox="0 0 20 20" data-offer-icon><path d="M7.5 5.5v9M12.5 5.5v9"></path></svg>
</span>
<span class="offer__body">
<span class="offer__title" data-offer-title>Pause for a month instead</span>
<span class="offer__line" data-offer-line>Keep everything. Billing resumes on 7 Dec.</span>
</span>
</div>
<div class="acts">
<button class="act act--keep" type="button" data-keep><span class="act__face" data-keep-words>Pause</span></button>
<button class="act act--cancel" type="button" data-cancel><span class="act__face">Cancel plan</span></button>
</div>
</div>
<!-- the end: the date, written out -->
<div class="view" data-view="done" aria-hidden="true">
<svg class="cal" viewBox="0 0 44 44" aria-hidden="true" data-cal>
<rect class="cal__body" x="7" y="9" width="30" height="28" rx="7" pathLength="1"></rect>
<path class="cal__ring" d="M15 5.5v7M29 5.5v7" pathLength="1"></path>
<path class="cal__line" d="M7.5 18h29" pathLength="1"></path>
<path class="cal__mark" data-cal-mark d="M16.6 27.4l3.6 3.4 7.4-7.6" pathLength="1"></path>
</svg>
<p class="done__lead" data-done-lead>Your plan ends on</p>
<p class="done__date" data-date aria-live="polite"><span class="done__chars" data-chars></span><i class="done__caret" data-caret aria-hidden="true"></i></p>
<p class="done__sub" data-done-sub>Plus stays on until then. A receipt is on its way.</p>
<button class="undo" type="button" data-undo>Keep my plan</button>
</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>
<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>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.
46 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 “Cancellation form” from Animorio and fit it into my siteThe six pills are a radiogroup of buttons with aria-checked and the keyboard arrows. The colour layer is a separate element under the words: GSAP takes it from scale 0.82 to 1 with back.out, the whole pill does a small elastic, the check (a path with pathLength 1) draws itself with stroke-dashoffset and its cell goes from 0 to 19 pixels wide, so the words move by themselves.
The field’s wrapper is measured at height auto, put back to zero and opened to the measured height with a light back.out; every frame the height of the views follows the one on show, so the card grows with the field.
The views sit on top of each other in absolute position and the card takes the height of the one on show with a tween; the one leaving slides 28 pixels and fades, the one arriving comes from the other side with back.out.
Each line has a red thread at scaleX 0 that stretches from the left, 0.38 seconds apart; halfway the line turns grey and jumps. The offer rises 6 pixels with a wider shadow and settles with elastic; the lit edge is a conic-gradient masked to a ring one and a half pixels wide, turned by GSAP through a CSS variable.
The calendar draws with stroke-dashoffset; each character of the date is a span that comes in blurred and a little lower with back.out, the caret follows because it sits after the letters in the same flex, and at the end it blinks and fades.
| Name | File | Default | What it changes |
|---|---|---|---|
BRAND | script.js | "Tidewell" | The name of the invented app. |
PRICE | script.js | "$9.99" | What the plan costs a month (the half price offer divides it by two). |
END_DATE | script.js | "30 Nov" | The day the cancelled plan ends. |
PAUSE_DATE | script.js | "7 Dec" | The day the pause ends. |
SPRING | script.js | 1.7 | How much the chosen pill bounces (0 = none). |
STRIKE_GAP | script.js | 0.38 | Seconds between one struck line and the next. |
LIFT | script.js | 6 | How far the offer lifts, in pixels. |
TYPE_SPEED | script.js | 1 | How fast the date and the autopilot’s text are written. |
LOOP | script.js | true | The autopilot starts again at the end. |
For the cancellation page of a subscription app, a SaaS service or a content platform: whoever leaves does it in three taps, with no tricks, and meanwhile leaves the reason and sees an honest alternative, a pause or a discount, before confirming.
The same animation: the card and its words are sized on both the width and the height of the box, the pills stay in two columns and a tap does what the pointer does, including the glow on the offer.
No springs, slides or lifts: the views change with a fade, the chosen pill takes its colour, the lines appear already struck, the offer fades in and the date appears letter by letter with no blur or movement.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 12 KB; the libraries: GSAP 28 KB.
Tested on 7 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.
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.