
The elastic button
Buttons, Hover, Text
A restaurant’s booking card, on white, in the style of real product interface pieces: a strip of days to swipe with your finger, with inertia and snapping, and a black pill that slides on a spring to the chosen day. Full days are struck through; below, that day’s times come in one after another, the guests change with a rolling digit and the button spells out the whole booking before confirming it 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>
<!--
"Table booking day strip" 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 day strip for booking a 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>
<!-- the booking card of a restaurant: a strip of days to swipe with inertia and snap, a pill that slides to the day
you pick, the times of that day coming in one after another, the guests with a rolling digit, and the button that
says the whole booking and confirms it with a drawn check -->
<section class="card" data-card aria-label="Book a table">
<header class="head">
<span class="mark" aria-hidden="true">
<svg viewBox="0 0 24 24"><path d="M7 3v7.5a2.5 2.5 0 0 0 5 0V3M9.5 3v18M17 3c-1.7 1.4-2.5 3.6-2.5 6.5V13h2.5v8"/></svg>
</span>
<span class="head__text">
<span class="head__name" data-name>Vellena</span>
<span class="head__sub">Book a table</span>
</span>
<span class="head__month" data-month>Oct · Nov</span>
</header>
<div class="strip" data-strip role="listbox" aria-label="Day" tabindex="0">
<div class="strip__track" data-track>
<span class="strip__pill" data-pill aria-hidden="true"></span>
</div>
</div>
<div class="row-head">
<span class="label">Time</span>
<span class="label label--soft" data-left>6 slots</span>
</div>
<div class="times" data-times role="listbox" aria-label="Time"></div>
<div class="guests">
<span class="label">Guests</span>
<div class="stepper">
<button class="step" type="button" aria-label="Fewer guests" data-minus>
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 12h12"/></svg>
</button>
<span class="count" aria-live="polite"><span class="count__num" data-num>2</span></span>
<button class="step" type="button" aria-label="More guests" data-plus>
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 12h12M12 6v12"/></svg>
</button>
</div>
</div>
<button class="cta" type="button" data-cta>
<span class="cta__fill" data-fill aria-hidden="true"></span>
<span class="cta__spin" data-spin aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 3a9 9 0 0 1 9 9"/></svg></span>
<svg class="cta__check" viewBox="0 0 24 24" aria-hidden="true"><path data-check d="M5.5 12.5 10 17l8.5-9"/></svg>
<span class="cta__label" data-label>Choose a time</span>
</button>
<p class="note" data-note>Free cancellation until the day before.</p>
</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.
23 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 “Table booking day strip” from Animorio and fit it into my siteThe day track is a flex row moved with gsap.set on every finger move; beyond the edges the move counts for a third, like a rubber band. On release the speed of the last moves times 220 milliseconds says how far it would go, and the position is rounded to the width of a day with power3.out.
The black pill sits in the track in absolute position, as wide as a day: picking another, it goes to its x with back.out, and meanwhile stretches a little from the side it leaves and comes back with an elastic, the more stretched the further it travels.
Each day has six of the nine evening slots, taken from a different point, and two of them are already booked. Changing day, the old ones rise and fade in a row, then the new ones come in from eight pixels below with a stagger and back.out.
The button’s text is put back together at every choice, day, time and guests, with a small change from above. Booking is a timeline: the press with its elastic, the spinning arc, the fill from the left with scaleX, the check with strokeDashoffset.
| Name | File | Default | What it changes |
|---|---|---|---|
RESTAURANT | script.js | Vellena | The restaurant’s name at the top of the card. |
ACCENT | script.js | #c4532c | The colour of the chosen time and of the button once booked. |
START_GUESTS | script.js | 2 | How many guests there are at the start. |
SPRING | script.js | 0.55 | The seconds the pill takes to slide to the chosen day. |
STAGGER | script.js | 0.05 | The seconds between one time and the next as they come in. |
PAUSE | script.js | 0.9 | The seconds the autopilot waits between one gesture and the next. |
For booking a restaurant, a bar or a venue, choosing the day of a visit, a class or an appointment, and anywhere a near day has to be picked with a thumb.
The card takes the full width minus the margins and the strip shows five and a half days, so you can tell it scrolls; the buttons stay finger-sized and in a short box the line under the name and the note at the bottom go away.
No springs and no bounces: the pill jumps to the chosen day, the times fade in, the digit changes without rolling, the booking shows the filled button with its check at once 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 8.0 KB; the libraries: GSAP 28 KB.
Tested on 27 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.