Skip to content
animorio
IT
All components

Grouped IBAN field

Forms, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.6 KBGSAP 28 KBFreeDownload the zip

The IBAN field of a payments app, on white: every four characters a gap opens on a small spring, the first two letters recognise the country and its code flips into the tag, as soon as the bank code is complete its name slides in under the field, and at the end the real IBAN check draws a blue tick or shakes the field with «Check digits don’t match». Continue lights up only when it’s right.

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>
<!--
  "Grouped IBAN 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>The IBAN field that splits into groups 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" data-stage>
    <!-- the payout account card of a payments app: the IBAN field opens a small gap every four characters, recognises
         the country from the first two letters, slides in the bank's name and checks the digits at the end, with a drawn
         check or a shake -->
    <section class="pay" data-card aria-label="Add a payout account">
      <header class="pay__head">
        <svg class="pay__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 8h14M5 12h9M5 16h5"></path></svg>
        <div>
          <p class="pay__brand"><span data-app>Tollmark</span> <span class="pay__crumb">/ Payouts</span></p>
          <p class="pay__sub">Where should we send your earnings?</p>
        </div>
      </header>

      <div class="pay__row">
        <label class="pay__label" for="iban">IBAN</label>
        <span class="pay__hint" data-hint>Up to 34 characters</span>
      </div>

      <div class="field" data-field>
        <span class="tag" data-tag aria-hidden="true">
          <svg class="tag__globe" viewBox="0 0 24 24" data-globe><circle cx="12" cy="12" r="8"></circle><path d="M4 12h16M12 4c2.4 2.3 3.6 5 3.6 8s-1.2 5.7-3.6 8c-2.4-2.3-3.6-5-3.6-8s1.2-5.7 3.6-8z"></path></svg>
          <span class="tag__code" data-code></span>
        </span>
        <span class="field__text" data-text aria-hidden="true"><span class="field__ph" data-ph>NL00 BANK 0000 0000 00</span><span class="caret" data-caret></span></span>
        <input class="field__input" id="iban" type="text" inputmode="text" autocomplete="off" autocapitalize="characters" spellcheck="false" maxlength="42" aria-describedby="iban-status" data-input>
        <svg class="field__ok" viewBox="0 0 24 24" aria-hidden="true" data-ok><circle class="ok__ring" cx="12" cy="12" r="9" data-ok-ring></circle><path class="ok__tick" d="M8 12.4l2.7 2.7L16.2 9.4" data-ok-tick></path></svg>
      </div>

      <div class="below">
        <p class="bank" data-bank aria-hidden="true">
          <svg class="bank__icon" viewBox="0 0 24 24"><path d="M4 10l8-5 8 5M6 10v7M10 10v7M14 10v7M18 10v7M4 19h16"></path></svg>
          <span class="bank__name" data-bank-name></span>
          <span class="bank__city" data-bank-city></span>
        </p>
        <p class="error" data-error aria-hidden="true">
          <svg class="error__icon" viewBox="0 0 24 24"><path d="M12 4l9 16H3z"></path><path d="M12 10v4M12 17v.01"></path></svg>
          <span>Check digits don’t match</span>
        </p>
      </div>
      <p class="sr" id="iban-status" aria-live="polite" data-status></p>

      <button class="go" type="button" disabled data-go>
        <span class="go__fill" data-go-fill></span>
        <span class="go__label" data-go-a>Continue</span>
        <span class="go__label go__label--b" data-go-b>
          <svg viewBox="0 0 24 24"><path d="M6 12.4l3.6 3.6L18 7.6" data-go-tick></path></svg>
          Account added
        </span>
      </button>
      <p class="pay__foot">Payouts arrive every Friday. No fees.</p>
    </section>

    <svg class="pointer" viewBox="0 0 24 24" aria-hidden="true" data-pointer><path d="M5 3l14 8.2-6.2 1.4 3.6 6.8-2.6 1.4-3.6-6.8L5 18.6z"></path></svg>
  </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.

24 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 “Grouped IBAN 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 sits the payouts card of Tollmark, an invented payments app: the black mark, «Where should we send your earnings?», the IBAN label and the grey field with the example in light grey. To the left of the field a small tag with a drawn globe. As you type, the characters come in, monospaced, one at a time with a small hop and, every four, a gap opens that bounces slightly: the number splits into groups by itself, the way you would read it. At the first two letters the globe shrinks and the country code flips into its place, NL; above the field the counter says how many characters are left for that country. When the bank code is complete, the name of the invented bank slides in under the field, Veldhaven Bank, Utrecht, with its icon. At the last character the IBAN is really checked, with the remainder of the division by 97: if the check digits don’t add up the field shakes, the border turns red and «Check digits don’t match» appears; if they do, a blue tick draws itself, the border lights up blue and Continue turns black with a small elastic bounce. Pressed, it fills with blue from the left and becomes «Account added» with its tick. A drawn pointer does it all by itself, getting the last digit wrong the first time, and starts again; you can also really type, and the field takes spaces and lowercase and tidies them up by itself.

How it works

The real field is invisible

On top of everything lies a real input at zero opacity, which receives the keyboard, touch and paste. What you see is a drawing: a span group for every four characters and a 1ch-wide span for every character. On each input the cleaned value is compared with the old one and only the difference is redrawn, so letters already typed never move.

The bouncing gap

The margin between one group and the next is a CSS variable, --gap. When a new group is born GSAP takes it from 0 to GAP pixels with back.out: the number opens up as if breathing and the new character comes in with a seven-pixel hop.

Country and bank

The first two letters are looked up in a small table of countries, with each one’s right length and where its bank code sits. The globe leaves, the code flips in with rotationX; when the bank code is complete the invented bank’s name slides in from the left.

The real check

At full length the first four characters move to the end, letters become numbers (A is 10) and the remainder by 97 is taken one digit at a time, with no giant numbers: if it comes out at 1 the IBAN is right. The autopilot’s IBAN is computed the same way, so it is real in form but invented.

Values to change

NameFileDefaultWhat it changes
APPscript.jsTollmarkThe name of the invented payments app, at the top of the card.
ACCENTscript.js#2563ebThe colour of the caret, the tick and the correct field.
TYPE_SPEEDscript.js11The letters per second the autopilot types.
GAPscript.js7The pixels of the gap that opens between one group of four and the next.
SPRINGscript.js2.6How much the gap bounces when it opens.
PAUSEscript.js1.4The seconds the autopilot waits between one gesture and the next.

Try them in the Playground

When to use it

For the payments form of an app or a shop, a platform’s payouts page, an order refund, a supplier’s sign-up: anywhere an IBAN is asked for and it pays to say right away whether it’s right.

On phones

The card takes the full width minus the margins, the field text drops to 11 pixels with 3.4vw so a whole Dutch IBAN fits on one line, and the real input underneath uses 16-pixel text, so Safari doesn’t zoom the page when it’s tapped. A tap opens the real keyboard.

With reduced motion

No hops and no bounces: the field already shows the correct IBAN split into groups, with the country code, the bank and the tick; typing, the characters appear without moving and the drawn pointer stays hidden.

Pitfalls

  • The remainder by 97 of an IBAN turned into a number has more than thirty digits: with Number precision is lost. It is computed one digit at a time keeping only the remainder.
  • Redrawing the whole text on every character made letters already typed hop in again: the new value is compared with the old one and only the changed characters are touched.
  • An input under 16 pixels on iPhone makes the page zoom on tap: the real, invisible one stays at 16 even when the drawn text is smaller.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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