
The elastic button
Buttons, Hover, Text
The VAT number field of a business checkout: the digits fall into groups, eleven marks count them, and at the eleventh the script tests the check digit. If it is wrong the field shakes in red; if it is right a spinner asks the registry and the company name opens below, in green.
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>
<!--
"VAT number field" 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>VAT number field</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">
<!-- a VAT number field for a business checkout: the digits fall into groups, eleven marks count them,
the check digit is tested as the last one lands and the registry answers with the company -->
<form class="vf" data-vf novalidate>
<div class="vf__top">
<label class="vf__label" for="vat">VAT number</label>
<span class="vf__hint" aria-live="polite"><span class="vf__roll"><span data-hint>11 digits</span></span></span>
</div>
<div class="vf__field" data-field>
<span class="vf__country" aria-label="Italy">
<i class="vf__flag" aria-hidden="true"><b></b><b></b><b></b></i>IT
</span>
<input class="vf__input" id="vat" data-input type="text" inputmode="numeric" autocomplete="off" spellcheck="false" placeholder="0000 0000 000" maxlength="13" aria-describedby="vat-out">
<span class="vf__status" aria-hidden="true">
<svg class="vf__spin" data-spin viewBox="0 0 22 22"><circle cx="11" cy="11" r="8" pathLength="1"></circle></svg>
<svg class="vf__mark" viewBox="0 0 22 22">
<path data-tick pathLength="1" d="M5.500 11.400 9.400 15.100 16.600 7.200"></path>
<path data-cross-a pathLength="1" d="M7 7 15 15"></path>
<path data-cross-b pathLength="1" d="M15 7 7 15"></path>
</svg>
</span>
</div>
<div class="vf__marks" data-marks aria-hidden="true"></div>
<div class="vf__out" id="vat-out" data-out>
<div class="vf__company" data-company>
<span class="vf__tile" aria-hidden="true">LS</span>
<span class="vf__who">
<b>Lumen Studio S.r.l.</b>
<span>Via dei Mille 12, Torino</span>
</span>
<span class="vf__pill">Active</span>
</div>
</div>
</form>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>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
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 “VAT number field” from Animorio and fit it into my siteThe eleventh digit of an Italian VAT number is a Luhn sum over the first ten: it is tested in the browser, calling no one, and the error comes the instant you finish typing.
Empty, typing, checking, right, wrong: the state is one word, and its colour lives in --tone. Border, halo, marks, spinner, check and label all read it.
The whole svg turns with transformOrigin at 50% 50%: the circle spins on itself and not round a far point. The answer opens the card by animating the height to the measured one.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #3157ff | The field’s colour while typing. |
GOOD | script.js | #159a5c | The colour of a verified VAT number. |
BAD | script.js | #d8452e | The colour of a wrong check digit. |
BASE | script.js | 0482915073 | The first ten digits of the demo’s VAT number: the script works out the eleventh. |
TYPE | script.js | 0.13 | The seconds between digits when the demo types by itself. |
CHECK | script.js | 1.3 | How many seconds the fake registry check lasts. |
HOLD | script.js | 3 | The seconds the result stays before the demo starts again. |
LOOP | script.js | true | Left alone, the field types itself: it gets the last digit wrong, fixes it and verifies. |
In the checkout of a shop that also sells to businesses, in the signup of a service for professionals, on the billing details page; and for any code with a check digit: IBAN, tax code, card number.
The same field, as wide as the screen, with the numeric keyboard. The demo never focuses the field by itself, so the keyboard does not open until you tap it.
Marks, colours and labels change without motion: the field does not shake, the spinner stays still and the company card appears already open.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.5 KB; the libraries: GSAP 28 KB.
Tested on 19 November 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.