Skip to content
animorio
IT
All components

Licence plate field

Forms, Hover, TextGSAP, CSS onlyMediumCompressed weight: Demo 5.0 KBGSAP 28 KBFreeDownload the zip

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.

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>
<!--
  "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>

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 “Licence plate field” 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, a “Licence plate” label with a status line on the right, and below it a European plate: black border, blue band with the country letter, seven slots with a small bar underneath (the waiting one is blue) split into three groups. As you type, each character arrives from above oversized and settles with a bounce while the plate takes the knock, and the status line counts how many are left. If you type a letter where a number goes the slot turns red and shakes its head, and the line says “A number goes here, not K”: the character is not written. With the seventh character the line turns green, “Plate recognised”, a glint crosses the metal, the characters make a wave and a tick is drawn in the corner. Backspace removes the last one. Underneath there is a real input.

How it works

The format in one line

FORMAT 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.

The real input, read first

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 knock

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.

Values to change

NameFileDefaultWhat it changes
PLATEscript.js"GF482KM"The plate the demo types by itself (made up).
FORMATscript.js"AA000AA"The format: A a letter, 0 a number (this is the Italian one).
BANDscript.js#1f4fd8The colour of the band and of the waiting slot’s mark.
STAMPscript.js0.42How many seconds a character takes to be stamped.
TYPEscript.js0.34Alone: how many seconds between one character and the next.
HOLDscript.js2.4Alone: how many seconds the finished plate stays before starting over.
LOOPscript.jstrueLeft alone, the plate types itself (with one mistake).

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • The demo never focuses the field by itself: it types by calling the same function as the keys, so on phones the keyboard does not open.
  • The refused character does not enter the input’s value: the error is said with aria-invalid and with the status line, which has words and not only colour.
  • The small yellow ring on the band is the flag mark on the plate, made with a dashed stroke: it is part of the object, not a status dot.

Libraries

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.

Testing

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