Skip to content
animorio
IT
All components

Reactions tooltip

Tooltips, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.2 KBGSAP 28 KBFreeDownload the zip

The reactions under a chat message, on black: three pills with a drawn icon and a count, plus one to add another. Resting on one, a smoked glass tooltip rises and tells who reacted: the faces slide in one after the other, overlapping, then the names, «Mara, Jonah and 10 others reacted with» and the little icon. Moving to the next reaction the tooltip does not close: it stretches or narrows to its new width on a spring, its tail glides to the new pill and the faces change. Tapping a reaction adds yours: the icon pops with a small burst of strokes, the count rolls up and your face enters at the front of the row pushing the others along; tap again and you leave.

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>
<!--
  "Reactions tooltip" 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 reactions tooltip that tells who reacted, with the faces sliding 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">
    <!-- the reactions under a chat message, on black. Resting on a reaction, a tooltip rises and tells who reacted:
         the faces slide in one by one and the names follow. Moving to another reaction, the tooltip stretches to its
         new width and the faces change places. Tapping a reaction adds yours: the icon pops, the count rolls and your
         face takes the front of the row in the tooltip -->
    <div class="kit" data-kit>
      <div class="tip" id="reactors" role="tooltip" data-tip>
        <div class="tip__in" data-tip-in>
          <div class="tip__faces" data-faces aria-hidden="true"></div>
          <div class="tip__words">
            <p class="tip__who" data-who></p>
            <p class="tip__how"><span data-how>reacted with</span><span class="tip__icon" data-tip-icon aria-hidden="true"></span></p>
          </div>
        </div>
        <svg class="tip__tail" data-tail viewBox="0 0 18 9" aria-hidden="true">
          <path class="tip__tail-fill" d="M0 0h18L10.4 7.6a2 2 0 0 1-2.8 0z"/>
          <path class="tip__tail-edge" d="M0.5 0.5L7.6 7.6a2 2 0 0 0 2.8 0L17.5 0.5"/>
        </svg>
      </div>

      <div class="bar" role="group" aria-label="Reactions" data-bar>
        <button class="chip" type="button" data-chip="fire" aria-pressed="false" aria-describedby="reactors">
          <span class="chip__light" aria-hidden="true"></span>
          <span class="chip__icon" aria-hidden="true">
            <svg viewBox="0 0 24 24"><path d="M12.3 3.2c.5 3-1.6 4.4-3 6.3-1 1.3-1.7 2.8-1.7 4.6a5.4 5.4 0 0 0 10.8.2c0-2.4-1.2-4.1-2.4-5.3.1 1.6-.5 2.7-1.5 3.3.4-3.2-.4-6.6-2.2-9.1z"/><path class="ic-in" d="M12 20.2a2.6 2.6 0 0 1-2.6-2.6c0-1.6 1.4-2.4 2.1-3.7.4 1 1.8 1.6 2.6 2.7.4.5.5 1 .5 1.2a2.6 2.6 0 0 1-2.6 2.4z"/></svg>
          </span>
          <span class="chip__n" data-n aria-label="12 reactions"><span class="num" data-num>12</span></span>
          <span class="chip__burst" data-burst aria-hidden="true"></span>
        </button>
        <button class="chip" type="button" data-chip="thumbs" aria-pressed="false" aria-describedby="reactors">
          <span class="chip__light" aria-hidden="true"></span>
          <span class="chip__icon" aria-hidden="true">
            <svg viewBox="0 0 24 24"><path d="M7.5 10.5v9h-3v-9z"/><path d="M7.5 19.5h9.1a2 2 0 0 0 2-1.6l1.1-5.4a2 2 0 0 0-2-2.4h-4.4l.6-3.4a1.8 1.8 0 0 0-3.3-1.3l-3.1 5.1"/></svg>
          </span>
          <span class="chip__n" data-n aria-label="8 reactions"><span class="num" data-num>8</span></span>
          <span class="chip__burst" data-burst aria-hidden="true"></span>
        </button>
        <button class="chip" type="button" data-chip="eyes" aria-pressed="false" aria-describedby="reactors">
          <span class="chip__light" aria-hidden="true"></span>
          <span class="chip__icon" aria-hidden="true">
            <svg viewBox="0 0 24 24"><ellipse cx="8" cy="12" rx="3.6" ry="5.2"/><ellipse cx="16" cy="12" rx="3.6" ry="5.2"/><circle class="ic-dot" cx="9" cy="13.2" r="1.5"/><circle class="ic-dot" cx="17" cy="13.2" r="1.5"/></svg>
          </span>
          <span class="chip__n" data-n aria-label="3 reactions"><span class="num" data-num>3</span></span>
          <span class="chip__burst" data-burst aria-hidden="true"></span>
        </button>
        <span class="bar__rule" aria-hidden="true"></span>
        <button class="chip chip--add" type="button" aria-label="Add reaction" data-add>
          <span class="chip__light" aria-hidden="true"></span>
          <span class="chip__icon" aria-hidden="true">
            <svg viewBox="0 0 24 24"><path d="M19.6 12.6A7.6 7.6 0 1 1 11.4 4.4"/><path d="M8.8 14.4c.8 1.1 1.9 1.7 3.2 1.7s2.4-.6 3.2-1.7"/><circle class="ic-dot" cx="9.2" cy="10.2" r="1"/><circle class="ic-dot" cx="14.8" cy="10.2" r="1"/><path d="M18.5 3.2v5M16 5.7h5"/></svg>
          </span>
        </button>
      </div>

      <svg class="pointer" data-pointer viewBox="0 0 20 24" aria-hidden="true"><path d="M2.2 1.6l15 11.2-6.6 1.1 3.7 7.3-2.6 1.3-3.7-7.3-4.9 4.6z"/></svg>
    </div>
  </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.

22 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 “Reactions tooltip” 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 a black ground a row of dark pills a little over forty pixels tall, with a thin edge that catches the light at the top: the flame with 12, the thumbs up with 8, the eyes with 3, a thin line and the face with a plus to add a reaction. On hover a soft light inside the pill follows the pointer. After a third of a second a smoked glass tooltip with its tail rises over the pill: on the left the faces of who reacted, round and coloured with their initials, sliding in one after the other from below and overlapping; on the right in white the names, Mara, Jonah and 10 others, and under them in grey reacted with and the little icon. Moving to the next pill the tooltip stays open: it stretches or narrows to the new words on a spring, the tail glides under the new pill, the words come in from the side you are moving towards and the new faces take the place of the old ones. Tapping a reaction the pill turns blue, the icon shrinks and pops with an elastic while six blue strokes fly out, the count leaves upwards and the new one arrives from below; in the tooltip your blue face enters at the front and the others slide right one place, and the line becomes You, Mara and 11 others. Tap again and your face leaves and the count goes back down. Left alone, a drawn arrow does the round: it opens the flame, adds the reaction, goes over the others, leaves and takes it back.

How it works

One tooltip that stretches

There is one tooltip for all the reactions. If it is already open, on change the old width is read, the new words are written, the new width is read and GSAP goes from one to the other with back.out; meanwhile the x of the tooltip and of the tail move under the centre of the new pill, kept inside the screen.

Faces kept by name

Every face knows its name: when you add your reaction the ones that stay are not redrawn but slide to their new place, yours enters at the front from below and the extra one leaves. So the row seems to make room instead of flashing.

The rolling count

The count sits in a one-line window: the old number leaves upwards (or downwards, if you remove the reaction) and the new one arrives from the other side with back.out, in tabular figures so the pill does not change width.

It waits only the first time

The first tooltip waits DELAY seconds, so it does not open when you just pass over; the next ones open at once, until the pointer leaves the reactions for more than GRACE seconds.

Values to change

NameFileDefaultWhat it changes
DELAYscript.js0.35The seconds on a reaction before the first tooltip opens.
GRACEscript.js0.2The seconds the tooltip waits before closing when the pointer leaves.
SPRINGscript.js1.5How far the tooltip and the faces overshoot when they arrive.
STAGGERscript.js0.06The seconds between one face and the next as they slide in.
FACESscript.js4How many faces the tooltip shows at most.
OVERLAPscript.js0.24How much each face covers the one before.
BURSTscript.js6How many strokes fly out of the icon when you add your reaction.
IDLEscript.js2.5The seconds without touching anything before the drawn arrow starts again.
LOOPscript.jstrueThe drawn arrow does the round again by itself.
--accentostyle.css#7b93ffThe blue of your reaction and of your face.

Try them in the Playground

When to use it

For the reactions of a messaging app, a forum, blog comments or a team workspace: wherever a number next to an icon hides people and it helps to say who they are without opening a window.

On phones

Without hover, a tap adds or removes your reaction and opens the tooltip at once, which closes by itself after a little over two seconds or with a tap outside; the tooltip always stays inside the screen.

With reduced motion

No jumps or springs: the tooltip, the faces and the words fade in and out, the count changes in place, the icon does not pop and there are no strokes.

Pitfalls

  • The tooltip width only animates if you know it before and after: read offsetWidth, write the words, set width back to auto, read again and then animate from one to the other with clearProps at the end.
  • The tooltip and the arrow live inside the component box (with room above and below), so the preview framing the component sees them whole.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 8.2 KB; the libraries: GSAP 28 KB.

Testing

Tested on 14 November 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