
The elastic button
Buttons, Hover, Text
The shipping address block of a checkout, on white, in the clean style of real product interface pieces: typing the street brings up suggestions underneath, filtering at every letter with the matched part in bold and a pill sliding onto the chosen one. Pick one with the arrows or a click: the list closes on a spring and City, Postcode and Country fill in one after another, letter by letter, with a flash on the border.
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>
<!--
"Address autocomplete" 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 address field that fills itself in</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 shipping address block of a checkout: typing in the address field brings up suggestions that filter as you type,
and choosing one fills City, Postcode and Country one after another, letter by letter, while the list closes on a spring -->
<section class="ship" data-card aria-label="Shipping address">
<header class="ship__head">
<svg class="ship__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 18 12 5l7 13"></path><path d="M8.5 13h7"></path></svg>
<div>
<p class="ship__title">Shipping address</p>
<p class="ship__sub">Quillcrest checkout · delivery in 2–3 days</p>
</div>
</header>
<div class="group" data-group>
<label class="label" for="addr">Address</label>
<div class="field field--search" data-field-addr>
<svg class="field__icon" viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="6.2"></circle><path d="m20 20-4.4-4.4"></path></svg>
<input id="addr" class="field__input" data-addr type="text" autocomplete="off" spellcheck="false"
placeholder="Start typing your street" role="combobox" aria-expanded="false" aria-controls="lista" aria-autocomplete="list">
<span class="field__caret" data-caret aria-hidden="true"></span>
</div>
<div class="drop" id="lista" data-drop role="listbox" aria-label="Suggested addresses">
<span class="drop__load" data-load aria-hidden="true"></span>
<span class="drop__pill" data-pill aria-hidden="true"></span>
<ul class="drop__list" data-list></ul>
<p class="drop__empty" data-empty>No matches. Try a street name.</p>
<button class="drop__manual" type="button" data-manual>
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 20h4L19 9l-4-4L4 16Z"></path><path d="m13.5 6.5 4 4"></path></svg>
Enter manually
</button>
</div>
</div>
<div class="row">
<div class="group">
<label class="label" for="city">City</label>
<div class="field" data-field="city"><input id="city" class="field__input" data-out="city" type="text" autocomplete="off"></div>
</div>
</div>
<div class="row row--two">
<div class="group">
<label class="label" for="post">Postcode</label>
<div class="field" data-field="post"><input id="post" class="field__input field__input--mono" data-out="post" type="text" autocomplete="off"></div>
</div>
<div class="group">
<label class="label" for="country">Country</label>
<div class="field" data-field="country"><input id="country" class="field__input" data-out="country" type="text" autocomplete="off"></div>
</div>
</div>
<footer class="ship__foot">
<p class="ship__note" data-note>We only ship to the address you choose.</p>
<button class="solidbtn" type="button" data-continue>
Continue
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12h13"></path><path d="m13 6 6 6-6 6"></path></svg>
</button>
</footer>
</section>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></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 “Address autocomplete” from Animorio and fit it into my siteAt every letter a gsap.delayedCall of SEARCH_DELAY seconds replaces the previous one: meanwhile a two-pixel gradient line stretches along the top edge of the dropdown. When it fires, the list filters the addresses with includes, keeps at most MAX_RESULTS and writes them with the matched part in a b.
The chosen item does not change its background: under the list there is a single grey pill in absolute position, which GSAP moves to the item’s offsetTop with back.out. The arrow keys, the pointer passing over and the autopilot all call the same setActive.
Opening, the dropdown goes from scaleY 0.92 to 1 with back.out from its top edge; closing, it first dips a pixel and stretches to scaleY 1.015 in eight hundredths of a second, then rises away with power3.in. That small dip is what makes it feel like a spring.
A timeline places each value FILL_STAGGER seconds after the previous one: an object with n going from zero to the text length writes value.slice(0, n) every frame, while an indigo border over the field goes from opacity 1 to 0 and the input hops two pixels with back.out.
The pilot does not fake the dropdown: it adds a letter to the input and calls the same search function as a real key, and sends keydown ArrowDown and Enter like the keyboard. A drawn caret, measured with a hidden copy of the text, blinks where the typing is. At the first real touch it stops, and it starts again after eight seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #4f5bd5 | The colour of the active border, the loading line and the flashes on the fields. |
SEARCH_DELAY | script.js | 0.3 | The seconds the list «searches» before showing the suggestions. |
MAX_RESULTS | script.js | 3 | How many suggestions the list shows at most. |
FILL_STAGGER | script.js | 0.22 | The seconds between one field filling in and the next. |
LETTER_TIME | script.js | 0.035 | The seconds per letter while the fields fill in. |
TYPE_SPEED | script.js | 0.11 | The seconds per letter the autopilot types. |
PAUSE | script.js | 2.4 | The seconds the autopilot leaves the filled address before starting again. |
For an online shop’s checkout, a delivery service’s address page, an app’s billing profile or any form where typing a full address is slow: you type a few letters and the rest comes by itself.
The card takes the screen width minus the margins, fields and rows shorten with vmin so everything fits in height, and the dropdown stays inside the card over the fields below. A tap chooses like a click and opens the real keyboard.
No springs and no arriving letters: the dropdown fades in and out, the pill jumps to the item, the fields fill in whole with a fade 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 8.0 KB; the libraries: GSAP 28 KB.
Tested on 26 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.