Skip to content
animorio
IT
All components

Free trial button

Buttons, HoverGSAP, CSS onlyEasyCompressed weight: Demo 4.6 KBGSAP 28 KBFreeDownload the zip

One button, one gesture, in the simple style of product interface pieces: the black «Start free trial» pill of a piece of software; on hover «14 days, no card» appears underneath, on tap the line squeezes and becomes fourteen thin ticks, one per day, and a light runs along them from the last to the first, which keeps the light and stands taller. The label becomes «Trial started».

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>
<!--
  "Free trial 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 free trial button with the days as ticks</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 fourteen days under the label become fourteen ticks, and the light runs back to the first -->
    <div class="trial" data-trial>
      <button class="trial__button" type="button" data-button aria-pressed="false" aria-label="Start free trial">
        <span class="trial__body" data-body>
          <span class="trial__label" aria-hidden="true">
            <span class="trial__word" data-word="start">Start free trial</span>
            <span class="trial__word" data-word="done">Trial started</span>
          </span>
        </span>
      </button>
      <div class="trial__meta" aria-hidden="true">
        <span class="trial__note" data-note>14 days, no card</span>
        <span class="trial__ticks" data-ticks></span>
      </div>
    </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.

17 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 “Free trial 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 that reads «Start free trial». Hovering brings the pill a touch closer and a quiet grey line rises underneath, «14 days, no card», coming in narrow and opening up on the width axis. On tap the pill gives and comes back on a spring; the line squeezes until it is gone and in its place fourteen thin ticks grow, one per day, from the middle out to the sides, each one a pixel too tall before it settles. Then a light in the accent colour runs along them from the last to the first: each tick lights up, rises by a hair and cools down; the first one keeps the light, stands taller, goes a pixel too far and settles, and its neighbour moves aside by a whisker as if nudged. At that moment «Start free trial» rises away and «Trial started» comes in narrow and opens up; the pill shortens on a spring as much as the new word needs. On a second tap the ticks fold back towards the middle and the line returns. On the phone the line is already visible at rest. Until someone touches it, the button plays the gesture by itself.

How it works

A line and its ticks

Under the pill there is a single grid cell holding two things: the line «14 days, no card» and a flex row of ticks, one and a half pixel wide spans made by the script, as many as DAYS. They sit on top of each other, so the line can become the ticks without anything moving.

The line squeezing

The line leaves by taking the wdth axis from 100 to 75 and the letter spacing below zero with power2.in: it seems to gather itself. The ticks grow with scaleY from zero, origin at the bottom, with a from center stagger and back.out, which gives the extra pixel before the settle.

The light running back

A loop from the last tick to the second puts two tweens per tick in the timeline, 50 milliseconds apart: it lights up in the accent colour and rises to 1.18, then goes back to grey and 1 in 0.42 seconds. So the light leaves a short trail. The first one goes to 1.62 and settles at 1.45 on an elastic spring.

The word at the right time

The label changes when the light reaches the first tick, not on the tap: «Trial started» is read just as day one lights up. The pill’s width follows the new word, measured in its final shape.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#2f6bffThe colour of the light on the ticks.
DAYSscript.js14How many days the trial lasts: one tick per day.
LABEL_STARTscript.jsStart free trialThe label on the button.
LABEL_DONEscript.jsTrial startedThe label once the trial has started.
NOTEscript.js14 days, no cardThe quiet line under the button.
SPRINGscript.js1How springy the press and the ticks are: 0.4 calm, 2 very bouncy.
SPEEDscript.js1The speed of everything: 2 twice as fast, 0.5 half.
HOLDscript.js2.4How many seconds the started trial stays 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 button that starts the free trial of a piece of software or a subscription app: the days can be seen, and the first lit tick says that day one is today.

On phones

On the phone the pill, the line and the ticks take their size from the screen (clamp on the shorter side); there is no hover, so the «14 days, no card» line is already visible at rest; everything else is the same.

With reduced motion

The line, the ticks and the words swap with a fade, with no springs or movement; the first tick is already lit and the pill takes its new width at once.

Pitfalls

  • The running light is made of separate tweens for each tick: with a single stagger and yoyo the first one would go out with the others, and it has to keep the light.
  • The label change starts with a delayedCall that has to be killed on every new tap: otherwise two quick taps size the pill for the wrong word.
  • On the way back the tick next to the first has to be put back at x zero: if the second tap arrives while it moves aside, it would stay half a pixel off.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 4.6 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