Skip to content
animorio
IT
All components

Fanning avatar stack

Avatars, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.9 KBGSAP 28 KBFreeDownload the zip

The header of a shared doc in Quire, a made up collaborative writing app, like a Dribbble shot: a white card with a one pixel edge, layered shadows and, in a recessed well, the stack of avatars of the people viewing it, initials on gradients with a ring of their own colour. As the pointer passes the stack fans out on a spring and every face stretches into a capsule with the name; someone arriving drops in at the front with a little bounce and pushes the others, someone leaving shrinks away and the stack closes up, and the +3 rolls its digits.

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>
<!--
  "Fanning avatar stack" 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 stack of avatars viewing the doc that fans out into names</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 header of a shared doc in Quire, a made up writing app. Under the title, in a recessed well, the stack of
         the people viewing it: initials on gradients, each with a ring of its own colour. Hovering it the stack fans out
         and every face grows into a capsule with the name; people come and go, and the +3 rolls its digits -->
    <article class="doc" data-card aria-labelledby="doc-title">
      <header class="doc__head">
        <span class="doc__icon" aria-hidden="true">
          <svg viewBox="0 0 24 24"><path class="doc__sheet" d="M7 3.5h7.2l4.3 4.3v11.2a1.5 1.5 0 0 1-1.5 1.5H7a1.5 1.5 0 0 1-1.5-1.5V5A1.5 1.5 0 0 1 7 3.5z"/><path class="doc__fold" d="M14.2 3.5v3.1c0 .7.5 1.2 1.2 1.2h3.1"/><path class="doc__lines" d="M8.6 11.6h6.8M8.6 14.4h6.8M8.6 17.2h4.2"/></svg>
        </span>
        <div class="doc__titles">
          <h2 class="doc__title" id="doc-title">Spring launch brief</h2>
          <p class="doc__meta">Quire <span aria-hidden="true">&middot;</span> Edited just now</p>
        </div>
        <button class="share" type="button" data-share>
          <span class="share__body">
            <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M8.3 11.7l3.4-3.4"/><path d="M9.6 6.2l1.3-1.3a3 3 0 0 1 4.2 4.2l-1.3 1.3"/><path d="M10.4 13.8l-1.3 1.3a3 3 0 0 1-4.2-4.2l1.3-1.3"/></svg>
            <span>Share</span>
          </span>
        </button>
      </header>

      <div class="live" data-live-well>
        <button class="stack" type="button" data-stack aria-expanded="false" aria-label="See who is viewing this doc">
          <span class="more" data-more aria-hidden="true">
            <span class="more__pill"><span class="more__plus">+</span><span class="roll" data-more-roll></span></span>
          </span>
        </button>
        <span class="live__count" data-count aria-hidden="true">
          <svg class="doc__eye" viewBox="0 0 20 20"><path d="M2.2 10s2.9-5.2 7.8-5.2 7.8 5.2 7.8 5.2-2.9 5.2-7.8 5.2S2.2 10 2.2 10z"/><circle cx="10" cy="10" r="2.4"/></svg>
          <span class="roll" data-count-roll></span>
          <span>viewing</span>
        </span>
      </div>

      <p class="doc__foot">
        <span class="event" data-event aria-hidden="true"><span class="event__text" data-event-text></span></span>
      </p>
    </article>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

24 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 “Fanning avatar stack” 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 white page a soft white card rises, with a barely there grain, a one pixel edge and layered shadows. At the top the indigo icon of a document with its folded corner, the title Spring launch brief, the line Quire · Edited just now and a black Share button with the link icon. Below, in a warm grey well, the stack of the people viewing: four overlapping rounds with white initials on gradients (coral, violet, teal, amber), each with a thin ring of its own colour set off from the well, and a +3 chip for the ones that do not fit; under it a drawn eye, 7 viewing and the latest thing that happened. As the pointer passes the stack fans out on a spring: the faces part one after the other, each round stretches into a light capsule of its colour with the name inside, coming in a little later, and the ring follows the new shape; over a capsule, that one rises by two pixels. Taking the pointer away the capsules close back into rounds and the stack tightens with a little settle. When someone arrives (Kenji, blue) the face drops in front of everyone, small, and lands with a bounce while a ring of its colour widens once and fades; the others get pushed one place, the next one squashes for a moment, the last one slides into the chip, which gives a small jolt, and +3 becomes +4 with the digit rolling up, like 7 viewing becoming 8. When someone leaves the face shrinks on the spot and disappears, the others close up and one of the hidden people comes out of the chip, while the digit rolls down and the line below says who left. The pilot's round opens the stack, brings Kenji in, lets Ava go, opens it again with the names, lets Kenji go and Ava come back, and ends as it started. With a finger a tap opens and closes the stack, from the keyboard Enter opens it and Esc closes it.

How it works

Every face is a capsule as wide as a round

Each person is an absolute span that GSAP moves with x and widens with width; inside, the capsule has a 999 pixel radius, hidden overflow and two box-shadows: a ring the colour of the well and one the colour of the person. Closed it is as wide as the round and only the gradient round shows; open it becomes the round plus the measured name, and the name, already there, is uncovered by the widening.

The places are computed, not written

A function reads the list of who is in and takes the first VISIBLE: closed they sit one ringed round minus OVERLAP apart, open one capsule plus SPREAD apart. Right after the last one sits the +N chip, and the same sum gives the width of the button that is the hover area. On the phone VISIBLE goes down by itself until the open capsules fit the well.

A real spring for every move

Every settle uses a damped oscillator, 1 minus e to the minus d times t times the cosine of a multiple of half pi: at the end of the tween it is exactly 1, so nothing snaps. The moves have one wave, the landing of someone arriving two, livelier with BOUNCE.

Who arrives, who gets pushed, who leaves

Someone arriving goes to the head of the list and drops from above, from 0.42 to 1 on the landing spring, with a ring that widens once; the next one squashes with scaleX 0.9 and comes back. The one that no longer fits slides to the chip's x and fades out shrinking; someone leaving shrinks on the spot and only then the others close up, and the first of the hidden comes out of the chip.

Digits that roll

Each digit is a window one line tall with a fade above and below, over a column from 0 to 9: GSAP takes it to yPercent minus ten times the digit on the same spring, so going up the number rolls up and going down it rolls down. The same function makes the +N and the number of viewers.

Values to change

NameFileDefaultWhat it changes
VISIBLEscript.js4How many faces show before the +N chip (on the phone it goes down by itself if the capsules do not fit).
OVERLAPscript.js0.3How much the faces overlap when the stack is closed, as a share of a round with its ring.
SPREADscript.js6The gap between the capsules when the stack is open, in pixels.
SPRINGscript.js1How springy every move is: 0.5 calm, 2 very bouncy.
BOUNCEscript.js1.6How much someone arriving bounces as they land.
ROLLscript.js0.55How many seconds the digits take to roll.
AUTOscript.jstrueOpens the stack and lets people come and go by itself until someone touches it.

Try them in the Playground

When to use it

In the header of a document, a whiteboard or a shared file in a collaboration app, in a dashboard that shows who on the team is online, on the page of a project or a meeting: it says at a glance how many people are there and, passing over, who they are, without opening a separate list.

On phones

On the phone the faces are a little smaller and the stack shows three people instead of four, so open with the names it fits the well; a tap on the stack opens it and another one closes it. The rest is the same.

With reduced motion

Nothing moves: the stack goes straight to its open or closed place and the names fade in, someone arriving fades in at the front, someone leaving fades out, the digits change in place with a fade.

Pitfalls

  • With x and width animated by the same tween, the face coming out of the chip started as wide as a capsule and ran through the others: someone coming out of the chip starts from the chip's x and the right width, and the capsule widens only afterwards.
  • The leaving face shrank while the others were already closing up, and for a moment two rounds sat on top of each other: the others start again only after a fifth of a second, when the leaving one is already small.
  • The person's colour ring, made with a border, was cut by the capsule's hidden overflow: it is a box-shadow, which stays outside the clip and follows the rounded shape even while it widens.
  • Open with the names, the four face stack spilled out of the well on the phone: the number of visible faces is measured at every resize on the widest possible capsule, and whoever does not fit goes into the chip.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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