Skip to content
animorio
IT
All components

Table booking day strip

Calendars, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.0 KBGSAP 28 KBFreeDownload the zip

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.

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

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.

23 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 “Table booking day strip” 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 white sits the card of Vellena, an invented restaurant: the fork and knife mark, the name, «Book a table» and the months of the strip, October and November. Below, a grey strip with fourteen days, the weekday small and the number large: you swipe it with your finger, it follows the hand with a little rubber band at the edges, keeps going with inertia when released and snaps to a day. Tapping a day, a black pill slides under it on a spring, stretching a little towards where it goes, and the number widens on the wdth axis. Three days are full: the number is struck through, dimmed, with Full written below, and tapping them only gives a small no. Changing day, the old times leave in a row and the new ones come in one after another, six per day, two already taken and struck through; above, how many are free. The chosen time turns terracotta with a small pop. Guests change with minus and plus, and the digit rolls up or down. The button, grey until a time is chosen, spells out the whole booking, for example «Book for 3 · Fri 31, 8:00 pm»: pressed it squashes, spins an arc, fills with terracotta from the left, draws the check and becomes «Booked». A drawn pointer swipes the strip, picks Friday 31, 8 in the evening, adds a guest and books, then starts again; it also really works, with finger, mouse and arrow keys.

How it works

A strip moved by hand

The 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 sliding pill

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.

Times that change

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 that says it all

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.

Values to change

NameFileDefaultWhat it changes
RESTAURANTscript.jsVellenaThe restaurant’s name at the top of the card.
ACCENTscript.js#c4532cThe colour of the chosen time and of the button once booked.
START_GUESTSscript.js2How many guests there are at the start.
SPRINGscript.js0.55The seconds the pill takes to slide to the chosen day.
STAGGERscript.js0.05The seconds between one time and the next as they come in.
PAUSEscript.js0.9The seconds the autopilot waits between one gesture and the next.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • A click at the end of a drag picked the day under the finger: beyond six pixels it counts as a drag and then the click does not count.
  • A day’s width is computed from the strip and redone on resize, together with the pill’s position: with a fixed width the strip on a phone showed days cut in half.

Libraries

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.

Testing

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