Skip to content
animorio
IT
All components

Quick reply notification

Notifications, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.4 KBGSAP 28 KBFreeDownload the zip

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.

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>
<!--
  "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>

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.

19 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 “Quick reply notification” 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, alone in the middle, there is the notification of a message: a white card with round corners, a barely visible border and a soft shadow, Ruth’s initials in a grey circle, the name, «now» in light grey and the message, «Are we still on for 3 pm?». It comes down a few pixels, goes a pixel too far and settles; the initials grow a moment later and the name and message slide into place. On the right is the Reply button, a grey pill: pressed, it gives a little and comes back on a spring, turns dark, and underneath the message the card stretches on a short spring. A thin rule draws itself from the left between the message and the field, the field drops in by a few pixels, and the caret in the accent colour starts to blink. The answer types itself with the rhythm of a real hand, a little slower after the comma, and as soon as there is a letter the Send button turns from grey to the accent colour with a small bounce. On sending the arrow leaves upwards and a new one rises from below, the field fades, the rule pulls back to the right and the card folds back; meanwhile the message rolls away and «You: Yes, see you there» comes in, and «now» becomes a check with «Sent». Shortly after the notification lifts away and a new one arrives. Hovering brings the card a pixel closer and the shadow widens. You can also really reply: Reply, type, Enter; Esc closes the field.

How it works

The measured drawer

The 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 that draws and pulls back

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.

The drawn caret

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 rolling lines

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.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#3d5afeThe colour of the Send button, the typing caret and the Sent check.
SENDERscript.jsRuth AdeyemiWho wrote the message: the initials come from here.
MESSAGEscript.jsAre we still on for 3 pm?The message that arrived.
ANSWERscript.jsYes, see you thereThe answer the notification types by itself.
TYPE_SPEEDscript.js16Letters per second when the answer types itself.
SPRINGscript.js1How springy the opening and the press are: 0.4 calm, 2 very bouncy.
HOLDscript.js1.8How many seconds «Sent» stays before the notification leaves.
AUTOscript.jstrueThe notification plays the gesture by itself until someone touches it.

Try them in the Playground

When to use 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 phones

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.

With reduced motion

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.

Pitfalls

  • Focusing the field while the answer types itself stole the keyboard from the page holding the demo: the caret is drawn and real focus only comes from a person’s tap.
  • Leaving the drawer height in pixels after opening made it wrong on a width change (the message wraps differently): once the spring ends it goes back to height auto.
  • The incoming word is absolutely positioned: without right 0 the message box cut it in half instead of adding the ellipsis.

Libraries

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.

Testing

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