
The inchworm menu
Menus, Hover, Transitions
A made-up restaurant’s «Book a table» button, on black: on click the graphite pill widens and itself becomes the wooden top of a long table seen from above, with a warm light coming on underneath. Adding guests with minus and plus, the digits roll and the chairs come out from under the table on a spring, split between the two sides and spread out again, the odd one goes to the head. «Tonight 20:30» is the quick pick that makes the table longer and brings out Confirm; confirming tucks the chairs back under the table and closes the pill into «Table for 4 · 20:30» with a drawn check.
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>
<!--
"Long table booking button" 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 Book a table button with the pill that becomes the long table</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>
<!-- a restaurant's Book a table button: on click the pill itself turns into a long wooden table seen from above,
the chairs come out from under it as guests are added, Tonight 20:30 is the quick pick, and Confirm
tucks the chairs back in and closes the pill on the booking -->
<div class="booker" data-booker>
<div class="table" data-table>
<span class="table__glow" data-glow aria-hidden="true"></span>
<div class="chairs" data-chairs aria-hidden="true"></div>
<div class="shell" data-shell>
<span class="skin skin--ink" aria-hidden="true"></span>
<span class="skin skin--wood" data-wood aria-hidden="true"><span class="skin__grain"></span></span>
<span class="shell__shine" data-shine aria-hidden="true"></span>
<span class="shell__edge" aria-hidden="true"></span>
<button class="face face--idle" type="button" data-open data-autoclic aria-expanded="false" aria-controls="booking">
<svg class="mini" viewBox="0 0 26 18" aria-hidden="true">
<rect class="mini__top" x="3" y="5.5" width="20" height="7" rx="3.5"></rect>
<path class="mini__chair" data-mini d="M8 2.6h3"></path>
<path class="mini__chair" data-mini d="M15 2.6h3"></path>
<path class="mini__chair" data-mini d="M8 15.4h3"></path>
<path class="mini__chair" data-mini d="M15 15.4h3"></path>
</svg>
<span class="face__label">Book a table</span>
</button>
<div class="panel" id="booking" data-panel aria-hidden="true">
<div class="stepper" data-stepper>
<button class="step" type="button" data-minus aria-label="One guest fewer">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M7.5 12h9"></path></svg>
</button>
<span class="count" aria-live="polite">
<span class="count__win"><span class="count__roll" data-roll></span></span>
<span class="count__word" data-word>guests</span>
</span>
<button class="step" type="button" data-plus aria-label="One guest more">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M7.5 12h9M12 7.5v9"></path></svg>
</button>
</div>
<button class="quick" type="button" data-quick aria-pressed="false">
<span class="quick__day">Tonight</span>
<span class="quick__time">20:30</span>
</button>
<button class="confirm" type="button" data-confirm aria-label="Confirm the booking" tabindex="-1">
<span class="confirm__fill" data-confirm-fill aria-hidden="true"></span>
<svg viewBox="0 0 24 24" aria-hidden="true"><path class="confirm__arrow" data-arrow d="M6 12h11.5M13 7.2l4.8 4.8-4.8 4.8"></path></svg>
</button>
</div>
<div class="face face--done" data-done aria-live="polite">
<svg class="tick" viewBox="0 0 24 24" aria-hidden="true"><path data-check d="m5.5 12.5 4.2 4.2 8.8-9.4"></path></svg>
<span data-booked>Table for 4 · 20:30</span>
</div>
</div>
</div>
<p class="note" data-note>Confirmation sent · <span>Osteria Lume</span></p>
</div>
<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.
24 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 “Long table booking button” from Animorio and fit it into my siteThe pill has two layers underneath: the graphite and the wood, made of two gradients, a radial highlight and two slightly tilted repeating-linear-gradients for the grain in multiply. Opening means animating the width on a back.out spring and fading the wood in, while a band of light crosses it once.
The chairs are in a layer behind the pill, the same size as it. Each has two places: the outer one, 10 pixels from the edge, and the hidden one, 14 pixels inside. A new chair starts from the hidden one at full opacity and moves out with back.out: it seems to come from under the top, with no masks.
A function gives, for n guests and a length, the place of every chair: even ones on top and odd ones below, spread between the two arcs of the pill, and with an odd number the last one at the head, turned by -90 degrees. Every chair is always the same element, so when the number or the length changes it slides from its old place to the new one on the same spring.
Every number is a new span that comes in from below (or from above when removing) with yPercent and a 0.72 scaleY, while the old one leaves the other way and is removed. «guest» becomes «guests» and the buttons switch off at the limits; a tap past the limit makes the number shake.
Confirm fills from the centre with a scale, the chairs go back in staggered, the pill is measured on the real text of «Table for 4 · 20:30» and the check draws itself with stroke-dashoffset. Measures are taken again on resize. A drawn pointer opens it, adds two guests, picks Tonight and confirms; at the first real touch it stops and starts again after eight quiet seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
SPRING | script.js | 0.62 | Seconds of the spring that widens the pill into the table and closes it. |
CHAIR_SPRING | script.js | 0.5 | Seconds of the spring that brings a chair out from under the table or moves it. |
HOLD | script.js | 2.8 | Seconds «Table for 4 · 20:30» stays before going back to «Book a table». |
START_GUESTS | script.js | 2 | How many guests there are when the table opens. |
MAX_GUESTS | script.js | 8 | The most guests, from 2 to 8. |
QUICK_TIME | script.js | 20:30 | The time of the «Tonight» quick pick. |
ACCENT | script.js | #ffb45e | The colour of the light under the table, of Confirm and of the check. |
WOOD | script.js | #d8bc93 | The colour of the table’s wood. |
On the site of a restaurant, an osteria, a bar or a venue: the button that opens a quick booking for tonight without going to another page. With another time it also suits a tasting or a dinner at an event.
The same animation: the open table is at most the screen width minus 32 pixels and the chairs spread along the real length. A tap is hover and click together; the buttons on the wood are 32 to 40 pixels.
Nothing moves: the pill changes width in one step, the wood, the chairs, the digits and the check arrive with a fade, with no springs or bounces; the pilot’s pointer is hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 9.3 KB; the libraries: GSAP 28 KB.
Tested on 11 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.