
The elastic button
Buttons, Hover, Text
The work chat of an invented app, on an almost black background, in the style of the light effects of AI apps: under a message that just arrived sits the Suggest reply button with a sparkle. Press it and a light starts running round its border and passes over the message as if reading it; then three suggested replies fan out of the button, one pill after another with a glint. Pick one: it flies down into the composer and writes itself there letter by letter, Send lights up and the reply goes out as your own message, with Sent and a tick that draws itself.
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>
<!--
"Suggest reply button" 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 Suggest reply button that fans out three AI replies</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 work chat: under a message just received, the Suggest reply button lights up and fans out three
suggested replies; pick one and it flies into the composer and writes itself, then Send -->
<article class="card" data-card aria-label="Chat with Teagan Brooks">
<header class="card__top">
<p class="card__chan">
<svg class="card__hash" viewBox="0 0 20 20" aria-hidden="true"><path d="M8 3.5 6.6 16.5M13.4 3.5 12 16.5M3.8 7.6h13M3.2 12.4h13"></path></svg>
<span>q4-review</span>
</p>
<p class="card__app">Quaywell</p>
</header>
<div class="msg" data-msg>
<span class="msg__avatar" aria-hidden="true">TB</span>
<div class="msg__main">
<p class="msg__who"><span>Teagan Brooks</span><span class="msg__time">10:42</span></p>
<p class="msg__text" data-msg-text>Can we move the review to Thursday? The deck still needs the new Q4 numbers.</p>
<span class="msg__sweep" data-sweep aria-hidden="true"></span>
</div>
</div>
<!-- the slot keeps the space for the suggestions and for the reply once it is sent -->
<div class="slot" data-slot>
<div class="fan" data-fan role="list" aria-label="Suggested replies"></div>
<div class="out" data-out aria-live="polite">
<p class="out__bubble" data-out-text></p>
<p class="out__state" data-out-state>
<svg viewBox="0 0 20 20" aria-hidden="true"><path data-tick d="M5 10.4 8.4 13.6 15 6.8"></path></svg>
<span>Sent</span>
</p>
</div>
</div>
<footer class="composer">
<div class="btnwrap" data-wrap>
<span class="btn__halo" data-halo aria-hidden="true"><span class="btn__spin" data-spin-halo></span></span>
<button class="btn" type="button" data-btn aria-label="Suggest reply">
<span class="btn__ring" data-ring aria-hidden="true"><span class="btn__spin" data-spin></span></span>
<span class="btn__face" aria-hidden="true"><span class="btn__shine" data-shine></span></span>
<span class="btn__in">
<svg class="btn__spark" data-spark viewBox="0 0 20 20" aria-hidden="true"><path d="M10 2.4c.55 4 2.2 5.65 6.2 6.2-4 .55-5.65 2.2-6.2 6.2-.55-4-2.2-5.65-6.2-6.2 4-.55 5.65-2.2 6.2-6.2Z"></path><path d="M15.4 13.6c.2 1.4.75 1.95 2.15 2.15-1.4.2-1.95.75-2.15 2.15-.2-1.4-.75-1.95-2.15-2.15 1.4-.2 1.95-.75 2.15-2.15Z"></path></svg>
<span class="btn__label" data-label></span>
</span>
</button>
</div>
<div class="field" data-field>
<span class="field__ph" data-ph>Reply to Teagan</span>
<span class="field__text" data-typed></span><span class="field__caret" data-caret aria-hidden="true"></span>
</div>
<button class="send" type="button" data-send aria-label="Send" disabled>
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M10 15.6V4.6"></path><path d="M5.4 9.2 10 4.6l4.6 4.6"></path></svg>
</button>
</footer>
</article>
<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 “Suggest reply button” from Animorio and fit it into my siteInside the pill sits a square with a conic gradient that rotates, clipped by the pill’s corners, and over it the dark face one pixel in from the edge: what stays visible is a thread of light running round. A blurred copy behind makes the glow. The button squashes on its wrapper and the gradient spins inside: two elements, two transforms.
Each pill already sits in its place in the column above the field; as it opens, the distance between it and the button’s sparkle is measured and it starts from there, small and tilted round its bottom left corner, each one a little more. Then it goes back to its place with back.out, the nearest first, and a glint runs across it.
The chosen pill flies to where the text starts in the field and melts with a touch of blur; the text writes itself one letter at a time. If the reply is longer than the field, text and caret slide left just enough to keep the end in view.
While a reply sits in the field, the button’s label goes to zero width and only the sparkle is left; the label changes text by rolling its letters, and the width follows on a soft curve.
| Name | File | Default | What it changes |
|---|---|---|---|
THINK | script.js | 1.2 | The seconds the AI thinks before opening the replies. |
FAN | script.js | 1 | How much the replies fan out as they leave the button (0 they rise straight). |
LIGHT | script.js | #9ecbff | The colour of the light on the border, the sparkle and Send. |
GLOW | script.js | 1 | How strong the glow running round the border is (0 none). |
TYPE_SPEED | script.js | 1 | How fast the reply writes itself in the field (2 twice as fast). |
PRESS_SCALE | script.js | 0.95 | How much the button squashes when pressed. |
SENT_HOLD | script.js | 2.2 | The seconds the sent reply stays before the loop starts again. |
For suggested replies in a messaging, email, customer support or work chat app with AI: the fan shows where the replies come from, and the choice flying into the field leaves the last word to the person before sending.
The same animation: the card takes almost the whole width, the pills sit in a column above the field and the reply slides inside the field when it is longer; sizes follow the screen height too.
No light passing over the message, no fan and no flight: the border lights up and fades, the pills fade in where they belong, the chosen reply appears in the field all at once and the sent one fades in; 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.5 KB; the libraries: GSAP 28 KB.
Tested on 28 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.