Skip to content
animorio
IT
All components

Table booking form

Forms, Hover, SVGGSAP, CSS onlyAdvancedCompressed weight: Demo 13 KBGSAP 28 KBFreeDownload the zip

The booking form of an invented osteria in a premium card, on a warm dark background with light from above and grain: on the left the round table seen from above, where the line-drawn chairs arrive on a spring and the plates draw themselves while the guest count rolls; on the right the days in a strip that scrolls, the free times the indicator reaches in snaps, skipping the full ones, and the notes field that grows as you write. On confirm the button fills with warm light and reads «Table for 4 · Fri 20:30», and the table lights up.

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 form" 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 table booking form with the table that lights up</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/opsz-italic.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- the booking card of a small osteria on a warm dark wall: the round table seen from above with line chairs that
         come to it on a spring, a strip of days, the free times that snap one by one, a notes field that grows, and a
         reserve button that turns into the booking while the table lights up -->
    <form class="book" data-card novalidate aria-label="Book a table at Osteria Calla">
      <span class="book__sheen" aria-hidden="true"></span>
      <header class="book__head">
        <div class="book__title">
          <p class="book__brand">Osteria Calla</p>
          <p class="book__sub">Wine bar and kitchen · dinner from 19:00</p>
        </div>
        <p class="book__chip" data-chip><span class="book__chip-roll" data-chip-roll><span>8 tables tonight</span><span>Booked · see you soon</span></span></p>
      </header>

      <div class="book__body">
        <section class="seat" aria-label="Guests">
          <div class="seat__table" data-table>
            <span class="seat__pool" data-pool aria-hidden="true"></span>
            <svg class="seat__svg" viewBox="0 0 200 200" aria-hidden="true">
              <defs>
                <radialGradient id="wood" cx="42%" cy="36%" r="70%">
                  <stop class="w1" offset="0"/>
                  <stop class="w2" offset="0.55"/>
                  <stop class="w3" offset="1"/>
                </radialGradient>
                <radialGradient id="lamp" cx="50%" cy="46%" r="55%">
                  <stop class="l1" offset="0"/>
                  <stop class="l2" offset="0.5"/>
                  <stop class="l3" offset="1"/>
                </radialGradient>
                <filter id="soft" x="-40%" y="-40%" width="180%" height="180%"><feGaussianBlur stdDeviation="6"/></filter>
              </defs>
              <circle class="seat__shadow" cx="102" cy="106" r="54" filter="url(#soft)"/>
              <g data-chairs></g>
              <g class="seat__top" data-top>
                <circle class="seat__wood" cx="100" cy="100" r="52" fill="url(#wood)"/>
                <g class="seat__grain">
                  <circle cx="98" cy="102" r="12"/><circle cx="98" cy="102" r="21"/><circle cx="99" cy="101" r="31"/><circle cx="100" cy="100" r="41"/>
                  <path d="M62 84c10-6 24-9 38-8M128 128c-9 6-21 9-34 8"/>
                </g>
                <circle class="seat__lamp" data-lamp cx="100" cy="100" r="52" fill="url(#lamp)"/>
                <circle class="seat__edge" cx="100" cy="100" r="51.5"/>
                <circle class="seat__rim" data-rim cx="100" cy="100" r="52.5" pathLength="1"/>
                <g data-plates></g>
                <g class="seat__vase" data-vase>
                  <circle cx="100" cy="100" r="5.2"/>
                  <circle cx="100" cy="100" r="2.4"/>
                  <g class="seat__leaves" data-leaves>
                    <path d="M100 100c3-6 9-9 15-8-2 6-8 9-15 8z"/>
                    <path d="M100 100c-6-2-9-8-8-14 6 2 9 8 8 14z"/>
                    <path d="M100 100c-3 6-9 8-14 6 3-5 8-7 14-6z"/>
                  </g>
                </g>
              </g>
            </svg>
          </div>
          <div class="guests">
            <span class="field__label" id="guests-label">Guests</span>
            <div class="stepper" role="group" aria-labelledby="guests-label">
              <button class="step" type="button" data-minus aria-label="One guest less"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 8h8"/></svg></button>
              <span class="count" aria-live="polite"><span class="count__roll" data-roll></span></span>
              <button class="step" type="button" data-plus aria-label="One guest more"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 8h8M8 4v8"/></svg></button>
            </div>
            <span class="guests__note" data-table-note>Round table by the window</span>
          </div>
        </section>

        <section class="pick">
          <div class="field field--days">
            <div class="field__row"><span class="field__label" id="day-label">Day</span><span class="field__aside">November</span></div>
            <div class="days" data-days-scroll>
              <div class="days__track" role="radiogroup" aria-labelledby="day-label" data-days>
                <span class="days__ind" data-day-ind aria-hidden="true"></span>
              </div>
            </div>
          </div>

          <div class="field field--times">
            <div class="field__row"><span class="field__label" id="time-label">Time</span><span class="field__aside" data-left>4 tables left</span></div>
            <div class="times" role="radiogroup" aria-labelledby="time-label" data-times>
              <span class="times__ind" data-time-ind aria-hidden="true"></span>
            </div>
          </div>

          <label class="field field--notes" data-notes-field>
            <span class="field__row"><span class="field__label">Notes for the kitchen</span><span class="field__aside" data-counter>0 / 120</span></span>
            <span class="notes" data-notes-box>
              <textarea class="notes__input" rows="1" maxlength="120" placeholder="Allergies, a birthday, a high chair" data-notes></textarea>
            </span>
          </label>

          <button class="reserve" type="submit" data-reserve>
            <span class="reserve__fill" data-fill aria-hidden="true"></span>
            <span class="reserve__sweep" data-sweep aria-hidden="true"></span>
            <span class="reserve__face" data-face-idle>
              <span class="reserve__words" data-words>Reserve a table for 2</span>
              <svg class="reserve__arrow" data-arrow viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9M8.5 4.2 12.3 8l-3.8 3.8"/></svg>
            </span>
            <span class="reserve__face reserve__face--done" data-face-done aria-hidden="true">
              <svg class="reserve__check" viewBox="0 0 16 16" aria-hidden="true"><path data-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/></svg>
              <span class="reserve__words" data-done-words>Table for 4 · Fri 20:30</span>
            </span>
          </button>
        </section>
      </div>
    </form>
    <p class="sr" aria-live="polite" data-live></p>
    <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"/></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.

37 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 form” 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 warm dark wall, lit from above like a dining room at night and with a fine grain, there is the card of Osteria Calla, about 660 pixels wide, with a thin edge catching the light and a layered shadow. At the top the name in italics, «Wine bar and kitchen · dinner from 19:00» and the «8 tables tonight» pill. On the left, in a slightly darker panel, the round table seen from above: the grained wood, a vase with three leaves in the middle, eight places marked on the edge; below, «Guests» with minus, the number and plus, and a line saying where you sit («Round table by the window»). Each extra guest brings a line-drawn chair that comes in from outside on a spring with a small turn, the place mark fades, the plate, its inner rim and the glass draw themselves, the table top settles and the leaves sway; the number rolls in a faded window and squashes slightly; removing one, the chair moves away and the plate is erased. On the right the strip of days (Today, Thu 5, Fri 6…, Monday closed and struck through) scrolls by itself to bring the chosen one to the middle, and an amber pill slides onto it on a spring. The times from 19:00 to 21:30 are a row: the ones full for the party size are struck through and shake their head when tapped; picking one, the indicator gets there in snaps, stopping on every free time in between and skipping the full ones, and next to the label you read how many tables are left. The «Notes for the kitchen» field is one line tall and as you write it grows on a spring, with the letter count. The «Reserve a table for 4» button squashes, a light crosses it, it fills with amber from the centre, the arrow leaves and «Table for 4 · Fri 20:30» rises in its place with the check drawing itself; the pill at the top rolls to «Booked · see you soon», the fields dim, and the table lights up: the lamp warms the wood, a ring of light runs around the edge and stays, the chairs and plates turn amber one after the other. The drawn pointer adds two guests, picks Friday and 20:30, writes the allergy note and confirms; then everything goes back and starts again.

How it works

The table in SVG

Eight places around the top, each a group moved and turned towards the centre, holding a group for the chair (which GSAP takes from y minus 16, scale 0.7 and a 9 degree turn to zero with back.out) and one for the setting: the place mark on the edge and three circles with pathLength 1, plate, inner rim and glass, drawn with strokeDashoffset. The places are taken in a fixed order: two facing each other, then the sides, then the corners.

The rolling number and the table that settles

The number is a column of digits in a one-line window, faded above and below with a mask: to show n the column rises by n minus one lines with back.out and squashes slightly. With each guest the table top takes 1.2 percent and comes back with elastic.out, and the vase’s leaves sway around the centre with svgOrigin.

The strip of days

The days sit in a container with overflow-x and faded ends; the indicator is an absolute pill in the same row, with the chosen day’s x and width read from offsetLeft and offsetWidth, and GSAP takes the container’s scrollLeft to bring the day near the middle.

Times in snaps

Each day has, for every time, the biggest party that still fits: below that number the time is full, struck through, and shakes its head. Picking a time, a timeline takes the indicator onto every free time in between with short power4.out tweens, and onto the last with back.out, skipping the full ones; if a change of guests fills the chosen time, the indicator moves to the first free one.

The notes that grow

With every letter the field measures itself by going to zero for an instant and reading scrollHeight, then goes back to its height and GSAP takes it to the new one with back.out. The pointer writes with a tween on a counter that, at every update, puts the first letters of the note in the field.

The confirmation and the table that lights up

A single timeline: the button squashes, a light crosses it, amber fills it with a circular clip-path, the content changes and the check draws itself. At the same time on the table a radial gradient in mix-blend screen warms the wood, a glow comes on behind, a circle with pathLength 1 and a dash one sixth long runs around with strokeDashoffset and then becomes whole, and a class turns the chairs and plates amber with a different delay for each.

Values to change

NameFileDefaultWhat it changes
SPRINGscript.js0.6How long the spring that brings a chair to the table lasts, in seconds.
STEPscript.js0.17How long each snap of the time from one free slot to the next lasts, in seconds.
GROWscript.js0.5How long the spring that grows the notes field lasts, in seconds.
HOLDscript.js3.4How many seconds the booking stays before the loop starts again.
START_GUESTSscript.js2How many guests there are at the start.
MAX_GUESTSscript.js8The most guests around the table, from 2 to 8.
NOTEscript.jsNo shellfish please, one of us has a nut allergy. It is also her birthday.The note the pointer writes by itself.
TYPE_SPEEDscript.js24How many letters per second the pointer writes.

Try them in the Playground

When to use it

For the «Book» page of a restaurant, an osteria, a wine bar or a hotel with a restaurant, or for a booking app: whoever books sees their table fill up while choosing, sees at once which times are full and leaves their allergies for the kitchen in the same form.

On phones

Below 560 pixels the table gets small next to the guests and the rest goes below, full width; the day and time labels disappear (they stay for screen readers), and the card fits in 341 by 410. The strip of days scrolls with a finger, the buttons are at least 30 pixels tall and a tap does what a click does.

With reduced motion

No springs or movement: the chairs and plates fade in in place, the number changes without rolling, the indicators jump to the right place, the field changes height at once, the check is already drawn and the table lights up with a fade; the drawn pointer is not shown.

Pitfalls

  • The chairs and settings sit in groups that already have their own transform attribute (place and rotation): GSAP animates a child group, otherwise its transform would wipe out the place’s.
  • In SVG gradients stop-color written as an attribute does not read CSS variables: the stop colours live in classes in the CSS, so the colour knobs change them.
  • The drawn pointer does not focus the notes field: in a preview inside a page, focus would steal the keyboard from whoever is reading the page. The field takes the focus look with a class.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Fraunces (font variabile) 5.3.0.

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

Testing

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