Skip to content
animorio
IT
All components

Shipping picker

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

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.

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

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.

33 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 “Shipping picker” 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 very light grey background sits the white shipping card of Mossgrove, an invented shop shipping from Rotterdam: the Shipping title, the 2 items pill and three options one under the other, each with its thin-stroke drawn icon, its name, its arrival day in grey, its price and a round box to tick. Standard is free and arrives on Thursday, Express costs 9 euros and arrives on Tuesday, Next day costs 18 euros and arrives tomorrow. A green frame with a veil of colour sits on the chosen option: picking another, the frame slides onto it on a short spring, narrows slightly at the sides and opens again, the circle fills green with a small snap and the white check draws itself. Each icon makes its own gesture: the parcel jumps and lands with two bounces, the van darts forward with its wheels turning and two speed lines, the stopwatch hand goes once around. Below, the summary: the Shipping line changes rising when the delivery costs more and falling when it costs less, and the total rolls digit by digit from the right, settling by a pixel. Continue to payment dips, its label rises and fades, an arc loader spins and the button turns green with a check and Shipping saved, then goes back to how it was. A drawn pointer does it all by itself and starts again; it also really works, with the mouse, touch and the keyboard arrows.

How it works

A single frame

The 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.

The total on rollers

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).

Up or down, depending on the price

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.

One gesture per icon

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.

The autopilot

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.

Values to change

NameFileDefaultWhat it changes
SUBTOTALscript.js64The total of the products in the cart, in euros, without shipping.
ACCENTscript.js#2f6b4fThe colour of the frame, the check and the button once it has saved.
SPRINGscript.js0.5The seconds the frame takes to slide onto the chosen option.
ROLLscript.js0.6The seconds the digits of the total take to roll.
LOADscript.js1.1The seconds of loading after Continue to payment.
PAUSEscript.js1The seconds the autopilot waits between one gesture and the next.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • A filled dot inside the choice circle would have been a dot in front of the item: the circle fills entirely with green and a white check draws itself inside.
  • The frame is measured in pixels with offsetTop and offsetHeight: on resize it goes straight back under the chosen row, because the demo window changes height and the rows with it.
  • With font-variant-numeric tabular-nums Mona Sans draws a slashed zero, which looks like a mistake in a price: the digits of the total stay proportional, but each column is as wide as the widest digit in its strip, so the price does not jiggle sideways as it rolls.

Libraries

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.

Testing

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