Skip to content
animorio
IT
All components

Clinic booking calendar

Calendars, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 9.0 KBGSAP 28 KBFreeDownload the zip

The card for booking a visit at a made-up clinic, on white: the doctor on top with her initials in a circle, below the seven days of the week as pills with availability ticks. The chosen day widens on a spring and the time grid opens underneath like an accordion, the times coming in staggered; the chosen time lights up, a copy of it flies into the “Tue 17 Nov · 15:00 · 30 min” summary and the Confirm visit button wakes up. Changing day closes the grid and opens it again with the new one.

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>
<!--
  "Clinic booking calendar" 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 clinic appointment calendar with the time slots that open</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 booking card of a made-up clinic: the doctor on top, the seven days of the week as pills with their
         availability ticks, the time grid that opens like an accordion under the chosen day, and the chosen time
         that lifts off the grid and lands in the summary, waking the Confirm visit button -->
    <section class="card" data-card aria-label="Book a visit">
      <span class="card__sheen" aria-hidden="true"></span>

      <header class="doc">
        <span class="doc__face" aria-hidden="true"><span class="doc__ring"></span><span class="doc__ini" data-ini>EM</span></span>
        <span class="doc__txt">
          <span class="doc__name" data-docname>Dr. Elena Marsh</span>
          <span class="doc__role"><span data-docrole>Dermatologist</span> · <span data-clinic>Wrenfield Clinic</span></span>
        </span>
        <span class="doc__mark" aria-hidden="true">
          <svg viewBox="0 0 24 24"><path d="M9.6 4.2h4.8v5.4h5.4v4.8h-5.4v5.4H9.6v-5.4H4.2V9.6h5.4Z"></path></svg>
        </span>
      </header>

      <div class="week" data-week role="radiogroup" aria-label="Day"></div>

      <div class="slots" data-slots>
        <div class="slots__in" data-slotsin>
          <p class="slots__head"><span class="slots__day" data-slotday>Choose a day</span><span class="slots__free" data-slotfree></span></p>
          <div class="grid" data-grid role="radiogroup" aria-label="Time"></div>
        </div>
      </div>

      <footer class="foot">
        <span class="sum" data-sum>
          <span class="sum__label">Your visit</span>
          <span class="sum__line" data-sumline><span class="sum__empty" data-sumempty>Pick a day and a time</span><span class="sum__full" data-sumfull><span data-sumday></span><i> · </i><span class="sum__time" data-sumtime></span><i> · </i><span data-sumlen></span></span></span>
        </span>
        <button class="confirm" type="button" data-confirm disabled>
          <span class="confirm__fill" data-confirmfill aria-hidden="true"></span>
          <span class="confirm__glint" data-confirmglint aria-hidden="true"></span>
          <span class="confirm__word" data-confirmword>Confirm visit</span>
          <svg class="confirm__ic" data-confirmic viewBox="0 0 24 24" aria-hidden="true"><path data-arrow d="M5 12h12.4M12.8 6.6 18.2 12l-5.4 5.4"></path><path data-tick d="M5.6 12.6 9.8 16.6 18.4 7.6"></path></svg>
        </button>
      </footer>
      <p class="sr" data-live aria-live="polite"></p>
    </section>

    <div class="flyer" data-flyer aria-hidden="true"></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>

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.

28 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 “Clinic booking calendar” 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 white background there is just a white card with rounded corners, a one pixel border, soft layered shadows and a faint teal veil along the top. At the top the doctor: a pale green circle with the initials EM and a thin ring around it, the name Dr. Elena Marsh, below it Dermatologist · Wrenfield Clinic, and on the right a tile with a cross drawn in line. Under a thin rule sit the seven days from Monday 16 to Sunday 22 November, grey pills with the weekday above the number; under each pill three ticks say how many times are left: three green for many, one for few, empty for none. Wednesday and Sunday are full: grey, with the number struck through. On hover a pill darkens slightly, pressed it squeezes and springs back. Once a day is chosen its pill widens on an elastic spring while the others narrow, it lights up in teal, the number widens on the wdth axis and the ticks hop one after the other. Underneath, the grid opens like an accordion with a small bounce: the title Thursday 19 November with 6 times free, then the eight times coming in staggered from below; the taken ones are dashed and struck through. Once a time is chosen its cell lights up, jolts and a copy of it lifts off, rises a touch and flies down to the summary on the left, where it loses its fill and becomes the green word between Thu 19 Nov and 30 min, settling by a pixel. Meanwhile the Confirm visit button wakes up: from grey it turns black, swells slightly, a shine crosses it and the arrow gives a nudge. Changing day empties the summary, puts the button back to sleep, the times leave in reverse order, the grid closes and opens again with the new day’s times; a full day opens an all dashed grid with Fully booked, and its grey pill shakes its head. Once confirmed the label leaves upwards, Visit booked comes in and the check draws itself. A drawn pointer picks Thursday at 10:30, looks at the full Wednesday, moves to Tuesday at 15:00, confirms, and the loop starts again.

How it works

The pills that widen

Each day is a flex column with flex-grow 1: GSAP takes the chosen one to WIDEN with elastic.out and brings the others back to 1, so the row redistributes itself with no measuring. The teal fill is a layer over the pill switched on through opacity; the number goes from font-stretch 92% to 122%.

The accordion of times

The container has overflow hidden and height 0. To open it a timeline fills the grid with the new day, measures the content height (a function, read when it starts) and reaches it with back.out, then leaves it on auto. Changing day the same timeline first sends the times out in reverse and closes to 0.

The time that flies into the summary

The summary takes its new words at once, so the target of the time can be measured. A fixed element as big as the cell starts from its rectangle and goes to the word’s one in the summary: x with power3.inOut and y with back.in, so it draws an arc; at the end its fill fades, the text turns green and the real word lights up in its place.

The button that wakes up

Confirm visit is disabled until a time is chosen. Waking it means switching on the black layer, brightening the label, a swell in scale keyframes, a running shine and a spring on the arrow. Once confirmed the check draws itself with stroke-dashoffset.

The fake pointer

A repeating timeline moves an SVG arrow to the centre of each element, read with getBoundingClientRect when it gets there, and calls the same functions as real clicks. The first real touch or key stops it for good.

Values to change

NameFileDefaultWhat it changes
DOCTORscript.jsDr. Elena MarshThe doctor’s name on top; the initials in the circle are made from it.
SPECIALTYscript.jsDermatologistThe specialty under the name.
CLINICscript.jsWrenfield ClinicThe name of the clinic.
VISIT_MINscript.js30How many minutes the visit lasts, written in the summary.
ACCENTscript.js#0e7a70The colour of the chosen day and time.
WIDENscript.js1.75How much the chosen day’s pill widens compared with the others.
SPRINGscript.js0.8How long the spring of the widening pill lasts, in seconds.
STAGGERscript.js0.04How many seconds between one time and the next as the grid opens.

Try them in the Playground

When to use it

On the booking page of a medical practice, a dentist, a physiotherapist or a beauty studio, in a clinic’s app, in any service with fixed length appointments: wherever the day comes first and then the time, and you want to see at once what you are confirming.

On phones

The card narrows to the screen width minus twenty-eight pixels and its paddings also follow the height; the pills narrow to about thirty pixels and the chosen one stays wider. Below 380 pixels the button and the summary get a little smaller to share one row. A finger taps like the mouse; without hover the press and the states remain.

With reduced motion

No springs, flights or hops: the chosen pill takes its width at once, the grid opens and closes with a fade, the time appears in the summary with a fade and the button lights up without swelling. The fake pointer is hidden: the states change on their own.

Pitfalls

  • The tween bringing the times in sat in the timeline with a still empty list (the times are created when the timeline gets there) and GSAP warned about invalid properties: now the tween starts from a call inside the timeline, once the times exist.
  • The flight of the time changed its fill from a gradient to a colour, which GSAP cannot blend, so it jumped: the fill is a separate layer that fades through opacity.
  • To know where the time lands the summary must already hold the new words: they are written before the flight, with the time word invisible, and its rectangle is measured.
  • The preview’s automatic click stopped the fake pointer: the button has no data-autoclic and the pilot stops only on real touches and keys (isTrusted).

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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