
The elastic button
Buttons, Hover, Text
One notification, one gesture, in the simple style of product interface pieces: Ruth’s message arrives, «Are we still on for 3 pm?», with a Reply button. Pressed, a field to answer opens underneath the message on a short spring, with a thin rule drawing itself from the left; the answer is typed right there, Send lights up in the accent colour, and on sending the field folds back, the message becomes the answer and «now» becomes «Sent» with a check.
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>
<!--
"Quick reply notification" 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 message notification with the reply that opens underneath</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>
<!-- one notification, one gesture: Reply opens a field underneath the message, the answer is typed in place,
Send folds it back and the notification says it went -->
<section class="toast" role="status" aria-live="polite" aria-label="New message" data-toast>
<div class="card" data-card>
<div class="head">
<span class="av" aria-hidden="true" data-av>RA</span>
<div class="txt">
<div class="meta">
<span class="name" data-name>Ruth Adeyemi</span>
<span class="when" data-when><span>now</span></span>
</div>
<p class="msg" data-msg><span>Are we still on for 3 pm?</span></p>
</div>
<button class="reply" type="button" aria-expanded="false" aria-controls="reply-field" data-reply><span class="reply__label" data-reply-label>Reply</span></button>
</div>
<div class="drawer" id="reply-field" data-drawer>
<div class="drawer__in">
<span class="rule" data-rule></span>
<form class="field" data-form autocomplete="off">
<span class="field__box">
<input class="field__input" type="text" maxlength="60" placeholder="Reply to Ruth" aria-label="Reply to Ruth" data-input>
<span class="field__mirror" aria-hidden="true" data-mirror></span>
<span class="field__caret" aria-hidden="true" data-caret></span>
</span>
<button class="send" type="submit" aria-label="Send" disabled data-send>
<span class="send__body" data-send-body>
<svg viewBox="0 0 20 20" aria-hidden="true"><path data-arrow d="M10 15.2V5.2M5.6 9.4 10 5l4.4 4.4"/></svg>
</span>
</button>
</form>
</div>
</div>
</div>
</section>
<svg class="tick-src" aria-hidden="true" width="0" height="0"><symbol id="tick" viewBox="0 0 14 14"><path d="M3 7.4l2.6 2.6L11 4.4"/></symbol></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.
19 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 “Quick reply notification” from Animorio and fit it into my siteThe field sits in a drawer of zero height with hidden overflow. On opening the height of its content is measured and GSAP reaches it with back.out: that is the short spring; at the end the height goes back to auto, so a window resize half way never leaves a stale number. On closing the real height is fixed and taken to zero with power3.inOut.
The rule is a one-pixel element scaling on the x axis: it comes in with the origin on the left and leaves with the origin on the right, so it does not retract where it came from but slides away.
While the answer types itself the field does not take focus (it would steal the keyboard from the page around it): an invisible span in the same font measures the text and a drawn caret in the accent colour sits at its end and blinks with a timeline of sets. When a person types, the real caret comes back, coloured with caret-color.
The message and «now» are boxes with hidden overflow: the old words rise and leave with power2.in, the new ones come from below with back.out and go a pixel too far. «Sent» brings its check along, an SVG symbol called with use.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #3d5afe | The colour of the Send button, the typing caret and the Sent check. |
SENDER | script.js | Ruth Adeyemi | Who wrote the message: the initials come from here. |
MESSAGE | script.js | Are we still on for 3 pm? | The message that arrived. |
ANSWER | script.js | Yes, see you there | The answer the notification types by itself. |
TYPE_SPEED | script.js | 16 | Letters per second when the answer types itself. |
SPRING | script.js | 1 | How springy the opening and the press are: 0.4 calm, 2 very bouncy. |
HOLD | script.js | 1.8 | How many seconds «Sent» stays before the notification leaves. |
AUTO | script.js | true | The notification plays the gesture by itself until someone touches it. |
For the notifications of a messaging app, a CRM or a team tool, when people should answer without leaving the page: the field opens where the message is and the confirmation stays in the same notification.
On the phone the card takes the width of the screen minus the margins and the type tightens slightly; there is no hover, a tap on Reply opens the field and the keyboard.
The notification fades in and out, the field appears already open with a fade, the lines swap without rolling and the caret stays still; no springs or movement.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.4 KB; the libraries: GSAP 28 KB.
Tested on 31 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.