Skip to content
animorio
IT
All components

Cancellation form

Forms, HoverGSAP, CSS onlyMediumCompressed weight: Demo 12 KBGSAP 28 KBFreeDownload the zip

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.

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

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.

46 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 “Cancellation form” 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 stands the white card of Tidewell Plus, an invented sleep and focus app, held up by soft layered shadows and a one pixel edge: at the top the mark with two waves, the Plus label and the price $9.99 / month. The first view asks Why are you leaving? with six pills in a two-column grid: Too expensive, Not using it, Found another app, Missing features, Bugs and issues and Other. The chosen pill swells with a light violet on a spring that overshoots by a pixel, its edge turns violet, a check draws itself and pushes the words aside, and the words widen on the wdth axis; the previous pill switches off. Only Other opens the Anything else? field under the pills, which grows on a spring and counts the characters; Continue lights up. Continue slides the view away and If you cancel, you lose arrives: 312 saved sessions, Offline downloads, Your 46-night sleep streak, struck out one after the other by a red thread, each line turning grey and jumping by two pixels. Then the offer lifts like a card: Pause for a month instead (or, if the reason was the price, Stay for half the price at $4.99), with a violet light running round its edge and a glow that follows the pointer. Pause and Cancel plan give under the finger and come back on a spring. At the end a calendar draws itself, Your plan ends on, and the date 30 Nov is written letter by letter behind a violet caret, with the receipt line and Keep my plan to go back (or Paused until 7 Dec if the pause is chosen). A drawn pointer does it all by itself and starts again; it also really works, with mouse, touch and keyboard.

How it works

Spring pills

The 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 that opens only with Other

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.

Three views, one card

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.

Struck lines and the offer

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 date that writes itself

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.

Values to change

NameFileDefaultWhat it changes
BRANDscript.js"Tidewell"The name of the invented app.
PRICEscript.js"$9.99"What the plan costs a month (the half price offer divides it by two).
END_DATEscript.js"30 Nov"The day the cancelled plan ends.
PAUSE_DATEscript.js"7 Dec"The day the pause ends.
SPRINGscript.js1.7How much the chosen pill bounces (0 = none).
STRIKE_GAPscript.js0.38Seconds between one struck line and the next.
LIFTscript.js6How far the offer lifts, in pixels.
TYPE_SPEEDscript.js1How fast the date and the autopilot’s text are written.
LOOPscript.jstrueThe autopilot starts again at the end.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • With the two-column grid the widening check never moves the other pills: in a row wrapping on its own, the chosen pill jumped to the line below.
  • The opening field has overflow hidden and clipped the focus ring: the wrapper has 5 pixels of negative margin and padding, so the ring stays whole.
  • The space in the date written letter by letter vanished inside an inline-block span: it needs white-space pre.
  • The views are in absolute position, so the card does not know its height: it is set by hand from the view on show, on resize too.

Libraries

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.

Testing

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