Skip to content
animorio
IT
All components

Flight baggage picker

Forms, Hover, PhysicsGSAP, CSS onlyMediumCompressed weight: Demo 7.7 KBGSAP 28 KBFreeDownload the zip

The bags step of a flight booking, alone on white in the premium style of product shots: a card with the personal item included, the cabin bag and the checked bag, each with its own stepper. Every bag you add drops in through the top edge of a small belt at the top of the card, as from a hatch,, squashes as it lands and springs back up, while the others slide aside on a spring to make room and the rollers give a shove; the total weight and the price roll. At the fare limit the plus refuses with a small shake and a red line says why; removing one, the bag lifts and leaves.

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>
<!--
  "Flight baggage 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 flight baggage picker with the suitcases dropping onto the belt</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 bags step of a flight booking: each bag you add drops onto a small belt at the top, the belt settles,
         the total weight and the price roll; at the limit the plus button refuses with a small shake -->
    <section class="bags" data-bags aria-labelledby="bags-title">
      <header class="bags__top">
        <div>
          <p class="bags__route">LIS <svg class="plane" viewBox="0 0 20 12" aria-hidden="true"><path d="M1 6h17m-4-4 4 4-4 4"/></svg> CPH · Corvane Air</p>
          <h1 class="bags__title" id="bags-title">Add bags</h1>
        </div>
        <p class="bags__weight"><span class="roll" data-kg aria-hidden="true"></span><span class="unit">kg</span><span class="sr" data-kg-sr>0 kg</span></p>
      </header>

      <div class="belt" aria-hidden="true">
        <div class="belt__stack" data-stack></div>
        <div class="belt__line"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></div>
      </div>

      <ul class="rows">
        <li class="row" data-row="personal">
          <span class="row__icon" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="6" y="8" width="12" height="11" rx="2.5"/><path d="M9.5 8V6.2c0-.7.6-1.2 1.2-1.2h2.6c.7 0 1.2.5 1.2 1.2V8"/></svg></span>
          <span class="row__text"><span class="row__name">Personal item</span><span class="row__sub">Under the seat · 40×30×15</span></span>
          <span class="row__free">Included</span>
        </li>
        <li class="row" data-row="cabin">
          <span class="row__icon" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="7" y="7" width="10" height="13" rx="2.5"/><path d="M10 7V4.5h4V7M12 4.5V3"/><path d="M9 20.5v1m6-1v1"/></svg></span>
          <span class="row__text"><span class="row__name">Cabin bag · 8 kg</span><span class="row__sub">Overhead locker · <b data-price-cabin></b></span></span>
          <span class="step" data-step="cabin">
            <button class="step__btn" type="button" data-minus aria-label="Remove a cabin bag"><svg viewBox="0 0 16 16"><path d="M4 8h8"/></svg></button>
            <span class="step__num"><span class="roll" data-count></span></span>
            <button class="step__btn" type="button" data-plus aria-label="Add a cabin bag"><svg viewBox="0 0 16 16"><path d="M4 8h8M8 4v8"/></svg></button>
          </span>
        </li>
        <li class="row" data-row="checked">
          <span class="row__icon" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="5.5" y="6" width="13" height="15" rx="2.8"/><path d="M9.5 6V3.5h5V6M9.5 10v7m5-7v7"/></svg></span>
          <span class="row__text"><span class="row__name">Checked bag · 23 kg</span><span class="row__sub">Dropped at the desk · <b data-price-checked></b></span></span>
          <span class="step" data-step="checked">
            <button class="step__btn" type="button" data-minus aria-label="Remove a checked bag"><svg viewBox="0 0 16 16"><path d="M4 8h8"/></svg></button>
            <span class="step__num"><span class="roll" data-count></span></span>
            <button class="step__btn" type="button" data-plus aria-label="Add a checked bag"><svg viewBox="0 0 16 16"><path d="M4 8h8M8 4v8"/></svg></button>
          </span>
        </li>
      </ul>

      <footer class="bags__foot">
        <p class="hint" data-hint aria-live="polite"></p>
        <div class="total">
          <span class="total__label">Bags</span>
          <span class="total__price">€<span class="roll" data-total aria-hidden="true"></span><span class="sr" data-total-sr>€0</span></span>
          <button class="go" type="button" data-go><span class="go__label">Continue</span><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h9m-3.5-3.5L12.5 8 9 11.5"/></svg><span class="go__shine"></span></button>
        </div>
      </footer>
    </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 “Flight baggage 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 white background there is only the bags card of a flight from Lisbon to Copenhagen with Corvane Air, a made-up airline: at the top the title Add bags and on the right the total weight in kilos, below it a small light belt with its grey rail and rollers, and three rows: the personal item, included with its green tag, the 8 kg cabin bag and the 23 kg checked bag, each with its drawn icon, its price and a pill stepper with minus and plus. Pressing plus the button squashes and springs back, the number rolls up, and a suitcase drops onto the belt: blue and shorter for the cabin bag, black, taller and with a yellow tag for the checked one. It falls tilted, straightens, hits the belt squashing and springs back up, its shadow spreads, the rollers give a shove and the other bags slide on a spring to stay centred. The weight and the total roll. The cabin bag always stands on the left. At the fare limit the plus fades; pressed anyway, the stepper shakes and Up to 3 checked bags on this fare appears in red below. With minus the bag lifts, tilts and leaves, the others close up. Continue sends a light through the pill. A drawn pointer packs the bags by itself, reaches the limit, takes one off and goes on.

How it works

The rows and the steppers

Each row is a list item with an SVG icon, the text and a stepper made of two real buttons with their own labels for screen readers. The state lives in an object with how many cabin and checked bags there are, and the fare limits.

The rolling numbers

Each number sits in a clipped window: the new value comes in from below with an elastic return while the old one leaves at the top, or the other way when removing. During the roll the window takes the width of the wider of the two, so 8 becoming 88 is not cut.

The bags on the belt

Each bag is one element moved by GSAP with children drawn in CSS: body, handle, straps, wheels, tag and shadow. The positions add up the widths plus the gap between them, centred on the belt; when one arrives, the others go to their new place with a back.out.

The drop

The new bag starts above the belt, tilted and slightly stretched, drops with power3.in, squashes for eight hundredths of a second and comes back with elastic.out; meanwhile the shadow spreads and the rollers shift back and forth, one after another.

The limit

Past the limit the plus fades but can still be pressed: pressed, the stepper shakes in four steps and the red line rises from below. The autopilot is a timeline rebuilt at every round that stops at the first real touch.

Values to change

NameFileDefaultWhat it changes
CABIN_PRICEscript.js18How much the cabin bag costs, in euros.
CHECKED_PRICEscript.js32How much each checked bag costs, in euros.
MAX_CHECKEDscript.js3The most checked bags allowed on this fare.
DROPscript.js1How high the dropping bag starts.
SQUASHscript.js0.14How much the bag squashes when it hits the belt.
GAPscript.js10The pixels between one bag and the next on the belt.
SPEEDscript.js1The speed of all the motion.

Try them in the Playground

When to use it

In the bags step of a flight, train, ferry or coach booking, in the cart of a travel agency, in a rental app with extras to add: anywhere you pick how many of something and it helps to see them arrive, with the total updating in front of you.

On phones

The card narrows to 92% of the screen and every size is in rem, which follows both the width and the height of the window: in the phone box the belt, the three rows and the total all fit. The stepper buttons stay big enough for a thumb.

With reduced motion

No drops, bounces or shakes: the bags fade in and out in place, the numbers change with a fade and the limit line appears still. The drawn pointer is hidden, the demo still loops.

Pitfalls

  • Nothing with a shadow may sit inside the window clipping the numbers: the overflow would cut it straight. The shadows live on the card and on the bags, outside any clip.
  • With two changes in a row the second comes while the first is rolling: only the last layer is kept and the others are removed at once, otherwise numbers pile up on each other.
  • GSAP moves the bags with x, y and scale: in the CSS the bag has no transform, only a transform-origin at the bottom centre so it squashes on the belt.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 7.7 KB; the libraries: GSAP 28 KB.

Testing

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