Skip to content
animorio
IT
All components

Vet booking form

Forms, Transitions, HoverGSAP, CSS onlyMediumCompressed weight: Demo 15 KBGSAP 28 KBFreeDownload the zip

The visit booking form of Fernwood Vet, a made-up veterinary clinic, in short steps inside one white card: the pet (Dog, Cat, Rabbit, Other, with small line icons and a white chip that slides under the choice on a spring), its name in a field whose label rises, the reasons for the visit as pills you can pick together, then the day and the free times, with the taken ones struck through. Every answer folds into a line with its value and the next step slides in, while the card height follows without jumps. If something is missing the step trembles slightly and a line says what is missing. Book visit spins for a moment, then the answers fly out of their lines and compose the summary, «Biscuit · Vaccines · Thu 21, 10:30».

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>
<!--
  "Vet 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>Vet booking form</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 visit booking card of Fernwood Vet, an invented clinic: four short steps in one card. Each answer folds
         into a line and the next step slides in on a spring; the card height follows without jumps. Book visit
         composes the summary from the answers. -->
    <form class="vb" data-card aria-labelledby="vb-title" novalidate>
      <header class="vb__head">
        <span class="vb__logo" aria-hidden="true">
          <svg viewBox="0 0 24 24"><path d="M9.5 7v10M4.5 12h10"/><path class="vb__leaf" d="M13.2 10.8c0-3.4 2.3-5.7 6.3-5.9-.1 3.9-2.4 6.2-6.3 5.9z"/></svg>
        </span>
        <span class="vb__meta">
          <span class="vb__brand">Fernwood Vet</span>
          <span class="vb__title" id="vb-title">Book a visit</span>
        </span>
        <span class="vb__len"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.6"/><path d="M8 5v3.2l2 1.3"/></svg><span>30 min</span></span>
      </header>

      <div class="vb__body" data-body>
        <div class="steps" data-steps>
          <!-- the pet -->
          <section class="st" data-step aria-labelledby="q-pet">
            <button class="st__row" type="button" data-row aria-expanded="true">
              <span class="st__q" id="q-pet">Who is coming in?</span>
              <span class="st__k">Pet</span>
              <span class="st__val"><span class="st__vin" data-val></span></span>
              <span class="st__edit" aria-hidden="true"><svg viewBox="0 0 16 16"><path d="M3.5 12.5 4 10l6.6-6.6a1.4 1.4 0 0 1 2 2L6 12l-2.5.5z"/></svg></span>
            </button>
            <div class="st__body" data-sbody>
              <div class="st__pad">
                <div class="seg" data-seg role="radiogroup" aria-labelledby="q-pet">
                  <span class="seg__mark" data-seg-mark aria-hidden="true"></span>
                  <button class="seg__opt" type="button" role="radio" aria-checked="false" data-pet="Dog">
                    <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M8 8.4c1.2-.9 2.5-1.3 4-1.3s2.8.4 4 1.3l.5 6.3c-1.2 2-2.7 3-4.5 3s-3.3-1-4.5-3z"/><path d="M8.1 8.3C6.4 6.6 4.2 7.4 4.3 10.2c.1 1.6 1.1 2.4 2.5 1.8M15.9 8.3c1.7-1.7 3.9-.9 3.8 1.9-.1 1.6-1.1 2.4-2.5 1.8"/><path d="M11 14.2h2l-1 1z"/><circle cx="10.2" cy="11.4" r=".55" class="fill"/><circle cx="13.8" cy="11.4" r=".55" class="fill"/></svg>
                    <span>Dog</span>
                  </button>
                  <button class="seg__opt" type="button" role="radio" aria-checked="false" data-pet="Cat">
                    <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6.2 10.4 6.3 5l3.6 2.8c1.4-.4 2.8-.4 4.2 0L17.7 5l.1 5.4c.6 4.6-1.9 8-5.8 8s-6.4-3.4-5.8-8z"/><path d="M11.2 13.8h1.6L12 14.7zM3.6 13.2l4 .5M3.9 15.6l3.8-.8M20.4 13.2l-4 .5M20.1 15.6l-3.8-.8"/><circle cx="10" cy="11.6" r=".55" class="fill"/><circle cx="14" cy="11.6" r=".55" class="fill"/></svg>
                    <span>Cat</span>
                  </button>
                  <button class="seg__opt" type="button" role="radio" aria-checked="false" data-pet="Rabbit">
                    <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9.9 9.2C8.6 5.4 8.7 2.8 9.9 2.8s1.6 3 1.4 6.1M12.7 8.9c-.2-3.1.2-6.1 1.4-6.1s1.3 2.6 0 6.4"/><path d="M12 8.6c3.3 0 5.4 2.2 5.4 5s-2.4 5.2-5.4 5.2-5.4-2.4-5.4-5.2 2.1-5 5.4-5z"/><path d="M11.2 14.6h1.6l-.8.8z"/><circle cx="10" cy="12.6" r=".55" class="fill"/><circle cx="14" cy="12.6" r=".55" class="fill"/></svg>
                    <span>Rabbit</span>
                  </button>
                  <button class="seg__opt" type="button" role="radio" aria-checked="false" data-pet="Other">
                    <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 12.2c2.6 0 4.8 2.3 4.8 4.3 0 1.6-1.3 2.4-2.6 2.1-1-.2-1.4-.5-2.2-.5s-1.2.3-2.2.5c-1.3.3-2.6-.5-2.6-2.1 0-2 2.2-4.3 4.8-4.3z"/><ellipse cx="9.2" cy="7.6" rx="1.5" ry="2"/><ellipse cx="14.8" cy="7.6" rx="1.5" ry="2"/><ellipse cx="5.8" cy="11.2" rx="1.3" ry="1.7"/><ellipse cx="18.2" cy="11.2" rx="1.3" ry="1.7"/></svg>
                    <span>Other</span>
                  </button>
                </div>
              </div>
            </div>
          </section>

          <!-- the name -->
          <section class="st" data-step aria-labelledby="q-name">
            <button class="st__row" type="button" data-row aria-expanded="false">
              <span class="st__q" id="q-name">What is their name?</span>
              <span class="st__k">Name</span>
              <span class="st__val"><span class="st__vin" data-val></span></span>
              <span class="st__edit" aria-hidden="true"><svg viewBox="0 0 16 16"><path d="M3.5 12.5 4 10l6.6-6.6a1.4 1.4 0 0 1 2 2L6 12l-2.5.5z"/></svg></span>
            </button>
            <div class="st__body" data-sbody>
              <div class="st__pad">
                <div class="field" data-field>
                  <input class="field__in" id="pet-name" data-name type="text" autocomplete="off" spellcheck="false" maxlength="16" aria-describedby="help-name">
                  <label class="field__label" for="pet-name" data-flabel>Pet's name</label>
                  <button class="field__go" type="button" data-next aria-label="Next">
                    <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M5 10h9.5M10.5 5.5 15 10l-4.5 4.5"/></svg>
                  </button>
                </div>
                <p class="help" id="help-name" data-help aria-live="polite"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.8"/><path d="M8 5.2v3.4M8 10.8v.1"/></svg><span></span></p>
              </div>
            </div>
          </section>

          <!-- the reason -->
          <section class="st" data-step aria-labelledby="q-why">
            <button class="st__row" type="button" data-row aria-expanded="false">
              <span class="st__q" id="q-why">What is the visit for?</span>
              <span class="st__k">Reason</span>
              <span class="st__val"><span class="st__vin" data-val></span></span>
              <span class="st__edit" aria-hidden="true"><svg viewBox="0 0 16 16"><path d="M3.5 12.5 4 10l6.6-6.6a1.4 1.4 0 0 1 2 2L6 12l-2.5.5z"/></svg></span>
            </button>
            <div class="st__body" data-sbody>
              <div class="st__pad">
                <div class="tags" data-tags role="group" aria-labelledby="q-why">
                  <button class="tag" type="button" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path class="tag__tick" d="M4 8.4 6.6 11 12 5.4"/></svg><span>Check-up</span></button>
                  <button class="tag" type="button" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path class="tag__tick" d="M4 8.4 6.6 11 12 5.4"/></svg><span>Vaccines</span></button>
                  <button class="tag" type="button" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path class="tag__tick" d="M4 8.4 6.6 11 12 5.4"/></svg><span>Skin</span></button>
                  <button class="tag" type="button" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path class="tag__tick" d="M4 8.4 6.6 11 12 5.4"/></svg><span>Not eating</span></button>
                  <button class="tag" type="button" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path class="tag__tick" d="M4 8.4 6.6 11 12 5.4"/></svg><span>Dental</span></button>
                  <button class="tag" type="button" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path class="tag__tick" d="M4 8.4 6.6 11 12 5.4"/></svg><span>Limping</span></button>
                  <button class="tag tag--next" type="button" data-next><span>Next</span><svg viewBox="0 0 20 20" aria-hidden="true"><path d="M5 10h9.5M10.5 5.5 15 10l-4.5 4.5"/></svg></button>
                </div>
                <p class="help" data-help aria-live="polite"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.8"/><path d="M8 5.2v3.4M8 10.8v.1"/></svg><span></span></p>
              </div>
            </div>
          </section>

          <!-- the day and the time -->
          <section class="st" data-step aria-labelledby="q-when">
            <button class="st__row" type="button" data-row aria-expanded="false">
              <span class="st__q" id="q-when">When suits you?</span>
              <span class="st__k">When</span>
              <span class="st__val"><span class="st__vin" data-val></span></span>
              <span class="st__edit" aria-hidden="true"><svg viewBox="0 0 16 16"><path d="M3.5 12.5 4 10l6.6-6.6a1.4 1.4 0 0 1 2 2L6 12l-2.5.5z"/></svg></span>
            </button>
            <div class="st__body" data-sbody>
              <div class="st__pad">
                <div class="days" data-days role="radiogroup" aria-label="Day">
                  <span class="days__mark" data-day-mark aria-hidden="true"></span>
                </div>
                <div class="times" data-times role="radiogroup" aria-label="Time">
                  <span class="times__mark" data-time-mark aria-hidden="true"></span>
                </div>
                <p class="help" data-help aria-live="polite"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.8"/><path d="M8 5.2v3.4M8 10.8v.1"/></svg><span></span></p>
              </div>
            </div>
          </section>
        </div>

        <!-- the booked visit, composed from the answers -->
        <section class="ok" data-ok aria-live="polite">
          <svg class="ok__tick" viewBox="0 0 48 48" aria-hidden="true">
            <circle class="ok__ring" cx="24" cy="24" r="20"/>
            <path class="ok__check" d="M15.5 24.6 21.4 30.4 32.8 18.4"/>
          </svg>
          <h2 class="ok__title" data-ok-title>See you Thursday</h2>
          <p class="ok__line" data-ok-line>
            <span class="tok" data-tok="name">Biscuit</span><span class="ok__sep" aria-hidden="true">·</span><span class="tok" data-tok="reason">Vaccines</span><span class="ok__sep" aria-hidden="true">·</span><span class="tok" data-tok="when">Thu 21, 10:30</span>
          </p>
          <p class="ok__sub">Dr. Ines Hale · Room 2 · a reminder the day before</p>
          <button class="ok__again" type="button" data-again>Book another visit</button>
        </section>
      </div>

      <button class="cta" type="button" data-cta aria-describedby="vb-title">
        <span class="cta__bg" aria-hidden="true"><span class="cta__sheen"></span></span>
        <span class="cta__label" data-cta-label>Book visit</span>
        <svg class="cta__spin" data-spin viewBox="0 0 20 20" aria-hidden="true"><circle cx="10" cy="10" r="6.5"/></svg>
        <svg class="cta__done" data-done viewBox="0 0 20 20" aria-hidden="true"><path d="M5.2 10.4 8.6 13.6 14.8 7"/></svg>
      </button>
    </form>
    <svg class="pointer" viewBox="0 0 24 24" aria-hidden="true" data-pointer><path d="M5 3.5 18.5 12 12.4 13.6 9.4 19.6z"/></svg>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

51 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 “Vet 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

A white card with a fine grain and a sage glow on top: the clinic brand, Book a visit and the visit length. The first step asks who is coming: four segments with line icons, and a white chip slides under the choice with a pixel of bounce while the icon hops. Once the pet is chosen, the step folds into a line (Pet, the icon and Dog rising from below) and the name slides in on a spring. The field has a rising label and a green focus ring; going on empty makes it tremble three pixels and a line says what is missing. The reasons are pills that light up with a tick that draws itself; the day and the time have a dark mark that slides under the choice, and taken times are struck through. With every answer in, the button lights up with a sheen; Book visit spins and the three answers fly from their lines into the summary, with the circle and the tick drawing themselves.

How it works

Four steps, each with its own height

Every step has three modes: hidden, open or done. Changing mode, GSAP tweens the step's height (or its body's) from 0 to auto or from auto to 0, all with the same duration and curve: the card grows and shrinks by itself, without measuring it, and the button at the bottom follows smoothly.

The step that slides in

When a step opens, its children rise 16 pixels with back.out(STEP_SPRING) and a 50 ms stagger; the one just done closes its body and the value rises from below in its line (yPercent 110 to 0), with a pencil to go back and change it.

The chips that slide under the choice

Pet, day and time each have a single absolutely positioned mark, taken to the choice's offsetLeft, offsetTop and size with back.out(MARK_SPRING) and an elastic squash in height; on resize and when a step opens it is put back in place.

Gentle validation

Next with an empty field gives no red error: the field takes a dark outline, trembles with x keyframes (0, -SHAKE, SHAKE, then smaller) and a line with an icon says what is missing, also announced to screen readers. Typing one letter closes the line again.

The summary that composes itself

Before anything moves, the final summary is measured (steps hidden, summary at auto height), then everything goes back: the three answers become absolutely positioned copies in the card, start from their lines and land in their places with x on power3 and y on back.inOut, so they make a small arc, while the card body goes from the old to the new height.

The pilot

A drawn pointer glances at Cat and picks Dog, tries Next with an empty name to show the tremble, types Biscuit, picks Vaccines, Tuesday then Thursday, 10:30 and books; after the summary it taps Book another visit and starts again. At the first real mouse move, tap or key it stops.

Values to change

NameFileDefaultWhat it changes
STEP_SPRINGscript.js1.5How far the next step overshoots as it slides in (0 none).
STEP_TIMEscript.js0.5Seconds for a step to fold and the next one to open.
MARK_SPRINGscript.js1.6How far the sliding chip overshoots under a choice (0 none).
SHAKEscript.js3Pixels the step trembles when an answer is missing (0 no tremble).
AUTO_NEXTscript.js0.38Seconds a single choice waits before the next step opens.
HOLDscript.js2.6Seconds the pilot stays on the booked visit.
SPEEDscript.js1Pilot speed.
LOOPscript.jstrueThe pilot starts over.

Try them in the Playground

When to use it

On the site of a veterinary clinic, a pet groomer or a pet hotel, but also a dentist, a physio or any practice that takes appointments: the whole booking in one card, with the answers staying in view and changing with one tap.

On phones

The same animation with adapted sizes: the card is 92% of the screen wide, lines, segments, days, times and the button also follow the window height, and under 470 pixels of height the visit length goes away. Every state of the pilot fits the phone box.

With reduced motion

Nothing moves: steps open and fold at once, the chips appear already under the choice, the empty field does not tremble but shows the help line, the summary fades in and the pilot's pointer is hidden.

Pitfalls

  • The centred card also moves when its height changes: the flying copies of the answers live inside the card and are measured against it, so they stay attached while the card moves.
  • To know where the answers land, the summary is shown and the steps hidden for an instant, measured, and everything is put back before the paint: without it the final places shift while the height animates.
  • The sliding marks are measured with offsetLeft: inside a hidden step it is 0, so they are put back one frame after the step opens and on every resize.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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