
The elastic button
Buttons, Hover, Text
The shipping step of a checkout, on white, in the style of product interface pieces: three delivery speeds one under the other, a green frame sliding on a short spring onto the chosen option and its icon making a small gesture. The shipping line changes rising or falling, the total rolls digit by digit and Continue to payment loads and saves.
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>
<!--
"Shipping picker" 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 shipping picker that updates the total</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 shipping step of a checkout: a frame slides onto the chosen option on a short spring, the option's icon does its
own small move, the shipping line swaps from below or above and the total rolls digit by digit; Continue loads and saves -->
<section class="ship" data-card aria-label="Mossgrove checkout, shipping">
<header class="ship__head">
<div>
<p class="ship__title">Shipping</p>
<p class="ship__sub">Mossgrove <span>/ Ships from Rotterdam</span></p>
</div>
<p class="ship__items">2 items</p>
</header>
<div class="opts" role="radiogroup" aria-label="Shipping speed" data-opts>
<span class="opts__frame" data-frame aria-hidden="true"></span>
<div class="opt" role="radio" tabindex="0" aria-checked="true" data-opt data-price="0" data-label="Free">
<svg class="opt__icon" data-icon="box" viewBox="0 0 24 24" aria-hidden="true">
<g data-move><path d="M3.6 7.6 12 3.4l8.4 4.2v8.8L12 20.6l-8.4-4.2Z"></path><path d="M3.6 7.6 12 11.8l8.4-4.2"></path><path d="M12 11.8v8.8"></path><path class="opt__tape" d="M7.8 5.5l8.4 4.2"></path></g>
</svg>
<span class="opt__text"><span class="opt__name">Standard</span><span class="opt__when">Arrives Thu, Oct 30</span></span>
<span class="opt__price">Free</span>
<svg class="opt__tick" viewBox="0 0 24 24" aria-hidden="true"><circle class="opt__ring" cx="12" cy="12" r="9"></circle><path class="opt__check" data-check d="M7.6 12.4l3 3 5.8-6.2"></path></svg>
</div>
<div class="opt" role="radio" tabindex="-1" aria-checked="false" data-opt data-price="9" data-label="€9.00">
<svg class="opt__icon" data-icon="van" viewBox="0 0 24 24" aria-hidden="true">
<g data-move><path d="M2.8 6.6h10.6v9.6H2.8Z"></path><path d="M13.4 9.4h4.2l3.6 3.6v3.2h-7.8"></path><path class="opt__speed" d="M0.6 9.8h1.4M0.2 12.8h1.8"></path></g>
<g data-wheel style="transform-origin: 7px 17.4px"><circle cx="7" cy="17.4" r="1.9"></circle><path d="M7 15.5v1.2"></path></g>
<g data-wheel style="transform-origin: 17.2px 17.4px"><circle cx="17.2" cy="17.4" r="1.9"></circle><path d="M17.2 15.5v1.2"></path></g>
</svg>
<span class="opt__text"><span class="opt__name">Express</span><span class="opt__when">Arrives Tue, Oct 28</span></span>
<span class="opt__price">€9.00</span>
<svg class="opt__tick" viewBox="0 0 24 24" aria-hidden="true"><circle class="opt__ring" cx="12" cy="12" r="9"></circle><path class="opt__check" data-check d="M7.6 12.4l3 3 5.8-6.2"></path></svg>
</div>
<div class="opt" role="radio" tabindex="-1" aria-checked="false" data-opt data-price="18" data-label="€18.00">
<svg class="opt__icon" data-icon="clock" viewBox="0 0 24 24" aria-hidden="true">
<circle cx="12" cy="13" r="7.8"></circle><path d="M9.6 2.8h4.8M12 2.8v2.4"></path>
<path class="opt__hand" data-hand d="M12 13V8.6" style="transform-origin: 12px 13px"></path>
</svg>
<span class="opt__text"><span class="opt__name">Next day</span><span class="opt__when">Tomorrow, by 9 pm</span></span>
<span class="opt__price">€18.00</span>
<svg class="opt__tick" viewBox="0 0 24 24" aria-hidden="true"><circle class="opt__ring" cx="12" cy="12" r="9"></circle><path class="opt__check" data-check d="M7.6 12.4l3 3 5.8-6.2"></path></svg>
</div>
</div>
<dl class="sum">
<div class="sum__row"><dt>Subtotal</dt><dd>€64.00</dd></div>
<div class="sum__row"><dt>Shipping</dt><dd class="swap" data-swap aria-live="polite"><span data-swap-a>Free</span><span data-swap-b aria-hidden="true"></span></dd></div>
<div class="sum__row sum__row--total"><dt>Total</dt><dd class="total" data-total aria-live="polite"></dd></div>
</dl>
<button class="cta" type="button" data-cta>
<span class="cta__label" data-cta-label>Continue to payment</span>
<span class="cta__busy" data-cta-busy aria-hidden="true"><svg viewBox="0 0 24 24"><circle class="cta__track" cx="12" cy="12" r="8"></circle><path class="cta__arc" data-arc d="M12 4a8 8 0 0 1 8 8"></path></svg></span>
<span class="cta__done" data-cta-done aria-hidden="true"><svg viewBox="0 0 24 24"><path data-done-check d="M6.4 12.6l3.6 3.6 7.6-8"></path></svg><span>Shipping saved</span></span>
</button>
</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>
</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.
33 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 “Shipping picker” from Animorio and fit it into my siteThe green frame belongs to no option: it is an absolute span inside the group, behind the rows. On choosing, GSAP takes it to the offsetTop and height of the new row with back.out(1.5) and meanwhile runs a scaleX fromTo from 0.975 to 1 with elastic: it narrows and opens again like a thing made of rubber.
Each digit of the total is a column one line tall holding a strip from 0 to 9: the right digit shows by moving the strip by −10 yPercent per unit. When the price changes only the changed digits roll, from right to left 50 milliseconds apart, with back.out(1.4).
The Shipping line has two spans in the same grid cell: the old one leaves upwards and the new one comes in from below if the delivery costs more, the other way round if it costs less. Then the two swap roles.
The icons are thin-stroke SVGs with a group that moves: the parcel jumps three pixels and lands with bounce.out, the van darts forward with its wheels spinning and two speed lines, the stopwatch hand goes once around its pin.
A timeline with repeatRefresh takes the drawn pointer to the options reading their real position every time and calls the same functions as real clicks. At the first real touch it stops, and it starts again from the top after eight quiet seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
SUBTOTAL | script.js | 64 | The total of the products in the cart, in euros, without shipping. |
ACCENT | script.js | #2f6b4f | The colour of the frame, the check and the button once it has saved. |
SPRING | script.js | 0.5 | The seconds the frame takes to slide onto the chosen option. |
ROLL | script.js | 0.6 | The seconds the digits of the total take to roll. |
LOAD | script.js | 1.1 | The seconds of loading after Continue to payment. |
PAUSE | script.js | 1 | The seconds the autopilot waits between one gesture and the next. |
For an online shop’s checkout, the delivery choice of a restaurant or a grocery service, the options step of a booking: wherever a choice changes a price and the total has to show it at once.
The card takes the full width minus the margins and the rows are sized on height too (10.8vh, between 42 and 58 pixels), so everything fits in the box; under 380 pixels the arrival day tightens and the city leaves the subtitle. A tap does what a click does.
No springs and no rolling: the frame, the shipping line and the digits change with a fade, the icons stay still, the check appears without drawing and the drawn pointer stays hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.8 KB; the libraries: GSAP 28 KB.
Tested on 26 October 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.