Skip to content
animorio
IT
Back to the library

Chat bubble transition

Transitions, HoverGSAP, CSS onlyMediumCompressed weight: Demo 10 KBGSAP 28 KBFreeDownload the zip

The home screen of Larkway, a made-up bank: the balance, the card, the last payment, and bottom right the round help bubble. Touched, the bubble squashes, two drops bud off towards the middle and it follows them like a liquid, swallows them and grows until it fills the screen: it becomes the chat with Mira, with the white sheet rising and the messages. You pick a question, the pill flies and becomes the sent message, Mira types and answers. Closing, the page shrinks back into the bubble, a drop left behind catches up on a thread of liquid and the bubble wobbles before settling. The liquid is an SVG goo filter. Premium style, one indigo.

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>
<!--
  "Chat bubble transition" 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 chat bubble that grows into the page</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 home screen of a made-up banking app, Larkway. Bottom right, the round help bubble. Touched, it grows like a
         liquid (two drops bud off it and are swallowed again) until it fills the screen and becomes the help chat;
         closing, the page shrinks back into the bubble with a drop that lags behind and rejoins it -->
    <section class="app" data-app aria-label="Larkway home">
      <div class="base" data-base>
        <header class="base__bar">
          <span class="brand">
            <svg class="brand__mark" viewBox="0 0 22 22" aria-hidden="true">
              <path d="M4 15.5c2.4-5.2 5.4-8.6 9.2-10.3M7.4 16.8c2.6-3.4 5.6-5.6 9.4-6.6"/>
              <circle cx="16.6" cy="5.4" r="1.5"/>
            </svg>
            <span class="brand__name">Larkway</span>
          </span>
          <span class="avatar avatar--me" aria-hidden="true">AK</span>
        </header>
        <p class="hello"><span class="hello__small">Good evening</span><span class="hello__name">Ada Kowal</span></p>
        <div class="balance">
          <span class="balance__label">Available</span>
          <span class="balance__value">&euro;2,480<span class="balance__cents">.20</span></span>
          <span class="balance__line" aria-hidden="true"><span class="balance__fill"></span></span>
          <span class="balance__note">62% of the Lisbon trip saved</span>
        </div>
        <ul class="rows">
          <li class="row"><span class="row__icon" aria-hidden="true"><svg viewBox="0 0 20 20"><rect x="2.5" y="5" width="15" height="10" rx="2.4"/><path d="M2.5 8.4h15"/></svg></span><span class="row__text"><b>Card 4417</b><small>Online payments paused</small></span><span class="row__tag">Check</span></li>
          <li class="row"><span class="row__icon" aria-hidden="true"><svg viewBox="0 0 20 20"><path d="M6 4.5h8l-1 11H7Z"/><path d="M7.6 7.6h4.8"/></svg></span><span class="row__text"><b>Ostra Caf&eacute;</b><small>Today, 18:42</small></span><span class="row__amount">&minus;&euro;4.80</span></li>
        </ul>
      </div>

      <!-- the liquid: every shape in here is blurred and sharpened again together, so shapes that come close melt -->
      <div class="goo" data-goo aria-hidden="true">
        <span class="blob" data-blob></span>
        <span class="drop" data-drop></span>
        <span class="drop" data-drop></span>
      </div>
      <span class="fab-shadow" data-shadow aria-hidden="true"></span>

      <section class="chat" data-chat aria-label="Help chat" aria-hidden="true">
        <header class="chat__head">
          <span class="avatar avatar--agent" aria-hidden="true">M</span>
          <span class="chat__who"><b>Mira from Larkway</b><small data-status>Usually replies in 2 min</small></span>
        </header>
        <div class="sheet" data-sheet>
          <div class="msgs" data-msgs>
            <p class="msg msg--in" data-in>Hi Ada, I&rsquo;m Mira. What can I help you with tonight?</p>
            <div class="chips" data-chips>
              <button class="chip" type="button" data-chip>My card was declined</button>
              <button class="chip" type="button" data-chip>Change my PIN</button>
              <button class="chip" type="button" data-chip>Savings goals</button>
            </div>
          </div>
          <div class="composer">
            <span class="composer__field">Write a message&hellip;</span>
            <span class="composer__send" aria-hidden="true"><svg viewBox="0 0 20 20"><path d="M10 15.5v-11M5.4 9 10 4.4 14.6 9"/></svg></span>
          </div>
        </div>
      </section>

      <button class="fab" type="button" data-fab aria-label="Open the help chat" aria-expanded="false">
        <span class="fab__light" data-light aria-hidden="true"></span>
        <svg class="fab__icon fab__icon--chat" data-icon-chat viewBox="0 0 24 24" aria-hidden="true">
          <path d="M5.2 6.6c0-1.3 1-2.3 2.3-2.3h9c1.3 0 2.3 1 2.3 2.3v6.6c0 1.3-1 2.3-2.3 2.3h-5.4l-3.7 3.1v-3.1c-1.2 0-2.2-1-2.2-2.3Z"/>
          <path class="fab__lines" d="M8.8 9.3h6.4M8.8 12h3.8"/>
        </svg>
        <svg class="fab__icon fab__icon--close" data-icon-close viewBox="0 0 24 24" aria-hidden="true"><path d="M7.5 7.5l9 9M16.5 7.5l-9 9"/></svg>
      </button>
    </section>

    <svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.8v16.4l4.2-4 2.8 6.2 2.9-1.3-2.8-6.1h5.9Z"/></svg>

    <svg width="0" height="0" class="defs" aria-hidden="true">
      <filter id="goo" x="-20%" y="-20%" width="140%" height="140%" color-interpolation-filters="sRGB">
        <feGaussianBlur in="SourceGraphic" stdDeviation="9" result="blur" data-goo-blur/>
        <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 22 -10" result="goo"/>
        <feComposite in="SourceGraphic" in2="goo" operator="atop"/>
      </filter>
    </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.

43 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 “Chat bubble transition” 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 warm grey sits the screen of Larkway, a made-up bank: the two-stroke mark, «Good evening, Ada Kowal», the balance card with the savings line for Lisbon, the card with online payments paused and the last coffee. Bottom right, the indigo help bubble with a soft light on top and its shadow. A pointer nearby draws it: it leans a few pixels towards it, swells a little and the icon tilts. Touched, the bubble squashes like someone taking a run-up, wider and lower, and two drops bud off towards the middle of the screen; the bubble follows them, melts onto them through a thread of liquid and grows until it fills everything. Meanwhile it climbs to the top corner and becomes the cross that closes. Then the chat arrives: Mira with her name, the white sheet rising one pixel past its place, the welcome message, three questions as pills and the field to write in. Touch a pill and the others leave, it lifts off and flies down to become the sent message, under the name «Mira is typing» appears with a light running over the letters, and the answer arrives. Closing, the sheet sinks, the page shrinks back into the bubble, a drop left behind catches up on a thread of liquid and the bubble wobbles a moment before settling. Left alone, a pointer opens the chat, asks a question and closes it, a different one each time.

How it works

The liquid is a filter

The bubble and the drops sit in a layer with filter: url(#goo): a 9 px feGaussianBlur blurs them all together and a feColorMatrix that multiplies the alpha by 22 and subtracts 10 makes them sharp again. Where two shapes come close their blurs add up and cross the threshold: the thread of liquid is born. A feComposite atop puts the real shape back on top, so the edges stay clean.

The bubble is a rectangle

The bubble is an element with left, top, width, height and border-radius measured in pixels: closed it is the circle of the button, open it is the whole screen. GSAP goes from one to the other in a second on power3.inOut. Before that, in 0.16 s, it squashes (1.22 by 0.9) keeping its right and bottom edges still: the run-up.

The drops ahead

Two drops leave the centre of the bubble towards the middle of the screen on power3.out, one bigger and nearer, the other smaller and further. The bubble arrives later and swallows them: in the filter it sees them as part of itself. Closing, the opposite: the drops leave the middle of the page on power3.in with a small delay, and stay tied to the bubble on a thread until they reach it.

The chat over the liquid

The chat is a layer on top, without the filter: it appears when the bubble is 62% of the way. First name and status, then the white sheet on back.out(1.15), then messages, pills and field, staggered. The round button climbs to the top corner with a tween of y, and the chat icon turns away as the cross arrives.

The pill becomes the message

The sent message is added at the bottom, where it will stay; the messages sit at the bottom of the sheet (justify-content: flex-end), so it does not move while the pills fold away above. We measure where the pill is and where the message is, and the message starts from the pill (x, y, scale, round corners) and reaches its place on back.out(1.4).

The return and the wobble

The sheet sinks, the bubble goes back to the circle of the button and, when the last drop lands, squashes a little (1.12 by 0.9) and goes round again on elastic.out(1.1, 0.35). The shadow, a separate element outside the filter, comes back last.

Values to change

NameFileDefaultWhat it changes
OPEN_TIMEscript.js1Seconds for the bubble to fill the screen and become the chat.
CLOSE_TIMEscript.js0.85Seconds for the page to shrink back into the bubble.
GOOscript.js9How soft the liquid is: the blur of the filter, in pixels. Higher, and shapes melt from further away.
DROP_SIZEscript.js0.46How big the drops that bud off are, compared with the bubble.
WOBBLEscript.js1How much the bubble wobbles when it settles (0 = not at all).
MAGNETscript.js6How many pixels the bubble leans towards the pointer.
TYPINGscript.js1.5Seconds Mira takes to answer.
IDLEscript.js5Seconds before the pointer plays by itself again.
LOOPscript.jstrueLeft alone, it opens the chat, asks a question and closes it, again and again.

Try them in the Playground

When to use it

For the help bubble of an app or a site (banks, shops, services), for a floating button that opens a whole page (new message, new post, the cart), and wherever a tap should lead to a page without making it pop out of nowhere.

On phones

The same animation with adapted sizes: the screen is min(420px, 92vw) by min(560px, 88vh), the bubble clamp(46px, 9.6vmin, 58px), the words in rem following the window. Bubble, drops and page are measured in pixels and put back in place at every resize, even halfway. A finger taps the bubble and the pills; the leaning bubble is there only with a mouse.

With reduced motion

No moving liquid and no flying pieces: the chat fades in and out over the screen, the sent message and the answer fade in. No pointer on its own.

Pitfalls

  • The goo filter also blurs the shadow: the bubble shadow is a separate element outside the filtered layer, and fades when the bubble grows.
  • Text and icons never go inside the filtered layer: they would be blurred and hardened like the liquid. The chat is a layer on top.
  • Bubble and drops need the same solid colour: the filter works on the alpha, and a different colour would leave a dirty edge where they melt.
  • If the sent message sat at the top of the sheet, folding the pills would move it while it flies: the messages sit at the bottom (flex-end).
  • The bubble leaning towards the pointer uses x and y; opening uses left and top: before opening x, y and scale go back to zero, or the open page would stay shifted.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 10 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 animations