
The elastic button
Buttons, Hover, Text
A form field for a car’s licence plate where the field is the plate: blue band on the left, seven slots, and each character is stamped into place with a knock. A letter where a number goes is refused with a shake and a line that explains; when the plate is complete a glint crosses the metal and a tick is drawn.
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>
<!--
"Licence plate 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>Licence plate field that builds a real plate as you type</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 field for a car's licence plate: the field is the plate; each character is stamped into its place, a
letter where a number goes is refused with a shake, and a complete plate takes a glint and a tick -->
<form class="pt" data-pt onsubmit="return false">
<div class="pt__head">
<label class="pt__label" for="pt-input">Licence plate</label>
<span class="pt__state"><span data-state>7 characters</span></span>
</div>
<div class="plate" data-plate>
<span class="plate__band" aria-hidden="true"><svg viewBox="0 0 20 20"><circle cx="10" cy="10" r="6.200"></circle></svg><b>I</b></span>
<span class="plate__chars" data-chars aria-hidden="true"></span>
<span class="plate__glint" data-glint aria-hidden="true"></span>
<svg class="plate__tick" viewBox="0 0 20 20" aria-hidden="true"><path data-tick pathLength="1" d="M4.500 10.400 8.300 14 15.500 6.200"></path></svg>
<input class="plate__input" id="pt-input" data-input type="text" inputmode="text" autocomplete="off" autocapitalize="characters" spellcheck="false" maxlength="9" aria-describedby="pt-hint">
</div>
<p class="pt__hint" id="pt-hint">Two letters, three numbers, two letters.</p>
</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.
17 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 “Licence plate field” from Animorio and fit it into my siteFORMAT is a string like “AA000AA”: A means letter, 0 number. From it come the slots (an extra gap where the kind changes) and the check on each character. Change the string and the plate changes.
A transparent input covers the plate. The script listens to beforeinput, stops the default typing and hands the characters one at a time to the function that accepts or refuses them: it works with the keyboard, with paste and on phones. The input’s value stays the accepted one.
The character starts at scale 1.5, ten pixels higher, and arrives with back.out(2.6); a little over a quarter of the way the plate drops a pixel and a half and comes back. The refusal is a shake of five jolts in x.
| Name | File | Default | What it changes |
|---|---|---|---|
PLATE | script.js | "GF482KM" | The plate the demo types by itself (made up). |
FORMAT | script.js | "AA000AA" | The format: A a letter, 0 a number (this is the Italian one). |
BAND | script.js | #1f4fd8 | The colour of the band and of the waiting slot’s mark. |
STAMP | script.js | 0.42 | How many seconds a character takes to be stamped. |
TYPE | script.js | 0.34 | Alone: how many seconds between one character and the next. |
HOLD | script.js | 2.4 | Alone: how many seconds the finished plate stays before starting over. |
LOOP | script.js | true | Left alone, the plate types itself (with one mistake). |
In the form of a car park, a car rental, an insurance quote or a garage, in a toll or parking app: wherever a plate is asked for and it pays not to let people get it wrong.
The same plate, as wide as the screen: slots and characters scale with the width (clamp), the input has a 16 pixel font so the page does not zoom on iPhone and asks the keyboard for capitals.
The characters appear in place without dropping, the wrong slot turns red for a moment without shaking, the glint does not pass and the tick appears.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.0 KB; the libraries: GSAP 28 KB.
Tested on 16 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.