
The elastic button
Buttons, Hover, Text
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.
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>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
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 siteOn 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 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.
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.
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.
| Name | File | Default | What it changes |
|---|---|---|---|
APP | script.js | Tollmark | The name of the invented payments app, at the top of the card. |
ACCENT | script.js | #2563eb | The colour of the caret, the tick and the correct field. |
TYPE_SPEED | script.js | 11 | The letters per second the autopilot types. |
GAP | script.js | 7 | The pixels of the gap that opens between one group of four and the next. |
SPRING | script.js | 2.6 | How much the gap bounces when it opens. |
PAUSE | script.js | 1.4 | The seconds the autopilot waits between one gesture and the next. |
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.
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.
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.
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.
Tested on 27 October 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.