Skip to content
animorio
IT
All components

Book a consultation button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 4.9 KBGSAP 28 KBFreeDownload the zip

The black «Book a consultation» button of an invented consulting studio, alone on white: on hover the letters roll up and away one after the other and the first free time rolls into the label, «Next Tue 10:30». On click the time is pinned: «Next» folds away, a ring in the accent colour draws itself in front of the time with a check inside, the digits tap down once and the line below becomes «Confirmed · invite sent».

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>
<!--
  "Book a consultation button" 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 Book a consultation button with the free time rolling in</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>
    <!-- one button, one gesture: the first free time rolls in through the label, and a tap pins it with a drawn check -->
    <div class="book" data-book>
      <button class="book__btn" type="button" data-btn aria-label="Book a consultation">
        <span class="book__body" data-body>
          <span class="book__tick" data-tick aria-hidden="true">
            <svg viewBox="0 0 24 24">
              <circle class="book__ring" data-ring cx="12" cy="12" r="9.5"/>
              <path class="book__check" data-check d="M7.6 12.4 10.6 15.3 16.6 8.9"/>
            </svg>
          </span>
          <span class="book__label" data-label aria-hidden="true">
            <span class="book__line" data-line="ask">Book a consultation</span>
            <span class="book__line book__line--slot" data-line="slot"><span class="book__pre" data-pre><span class="book__prein">Next</span></span><span class="book__time" data-time>Tue 10:30</span></span>
          </span>
        </span>
      </button>
      <p class="book__note" aria-live="polite">
        <span class="book__noteline" data-note="ask">Halden Partners · 45 min, free</span>
        <span class="book__noteline" data-note="done">Confirmed · invite sent</span>
      </p>
    </div>
  </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.

19 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 “Book a consultation button” 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, alone in the middle, there is a black pill reading «Book a consultation» and below it a small grey line with the name of the invented studio and the length, «Halden Partners · 45 min, free». On hover the pill leans in a touch and the letters of the label roll up and away one after the other, like a departure board; from below the first free time arrives, «Next Tue 10:30», with «Next» in a lighter tone, and the pill narrows on a spring to fit the time. On click the pill gives and comes back: «Next» folds away, in front of the time a space opens for a ring in the accent colour that draws itself round from the top, then a check strokes inside it, going a pixel too far and settling. The digits of the time tap down by a pixel and a half one after the other, as if pinned. The line below rises away and «Confirmed · invite sent» arrives. On a second click the check slides off its far end, the ring unwinds, the time drops away and the label comes back from above. Until someone touches it, the pill plays the gesture by itself.

How it works

One letter at a time

The label and the time are split into letters, each in an inline-block span, and they sit in the same cell of a one-line grid, clipped only above and below with clip-path. The old letters rise with power2.in and a 12 millisecond stagger, the new ones come up from below with back.out and a slower stagger: you read the motion, not the swap.

The pill following the word

The label’s width is not left to the CSS: GSAP takes it to the width of the line on show, measured in its final shape and divided by the pill’s scale, with back.out. So the pill narrows onto the time and widens back onto the sentence with a pixel of bounce.

The ring and the check

The check’s slot is zero wide until the time is pinned, then opens on the same spring as the pill while «Next» folds to zero width. The ring draws with strokeDashoffset starting from the top (rotated by minus 90 degrees), the check goes to minus 0.9, a pixel past its end, and back to zero: that is the settle.

The digits tapping down

As the ring starts, the letters of the time drop by a pixel and a half in 90 milliseconds and come back up on an elastic, one after the other: it is the knock that says «pinned», with no flash and no extra colour.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#5b7cffThe colour of the ring around the check.
LABELscript.jsBook a consultationThe button’s words at rest.
SLOTscript.jsTue 10:30The first free time that rolls in.
NOTEscript.jsHalden Partners · 45 min, freeThe small line under the button.
NOTE_DONEscript.jsConfirmed · invite sentThe line below once the time is booked.
SPRINGscript.js1How springy the pill and the check are: 0.4 calm, 2 very bouncy.
SPEEDscript.js1The speed of everything: 2 twice as fast, 0.5 half.
HOLDscript.js2.2How many seconds it stays booked when the button plays by itself.
AUTOscript.jstrueThe button plays the gesture by itself until someone touches it.

Try them in the Playground

When to use it

For the main button on the site of a studio, a consultant or a freelancer: it shows the first free time before the click, so booking feels like a single step.

On phones

On the phone the pill and the words take their size from the screen (clamp on the shorter side); there is no hover, so on tap the time rolls in and is pinned straight away, in the same gesture.

With reduced motion

The words, the ring and the check swap with a fade, with no rolling letters and no springs; the pill takes its new width at once.

Pitfalls

  • Spaces between words, once split into letters, vanish in inline-blocks: the letters need white-space pre, otherwise «Book a consultation» becomes a single word.
  • The width has to be measured with the pill’s scale divided out: if the pill is at 0.955 from the press while measuring, the label comes out shorter and the last letter spills over the edge.
  • «Next» folds by animating its width, so its real width has to be measured by setting it back to auto for an instant, every time: after the first round it is zero.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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