
The layered button
Buttons, Hover, Physics
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.
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>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 “Flight baggage picker” from Animorio and fit it into my siteEach 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.
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.
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 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.
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.
| Name | File | Default | What it changes |
|---|---|---|---|
CABIN_PRICE | script.js | 18 | How much the cabin bag costs, in euros. |
CHECKED_PRICE | script.js | 32 | How much each checked bag costs, in euros. |
MAX_CHECKED | script.js | 3 | The most checked bags allowed on this fare. |
DROP | script.js | 1 | How high the dropping bag starts. |
SQUASH | script.js | 0.14 | How much the bag squashes when it hits the belt. |
GAP | script.js | 10 | The pixels between one bag and the next on the belt. |
SPEED | script.js | 1 | The speed of all the motion. |
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.
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.
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.
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.
Tested on 14 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.