Avatar Stack

Overlapping avatar group with count.

A B C +9
Tailwind CSS
<div class="flex items-center">
  <span class="w-9 h-9 rounded-full bg-indigo-500 border-2 border-white flex items-center justify-center text-white text-xs font-bold">A</span>
  <span class="w-9 h-9 rounded-full bg-purple-500 border-2 border-white flex items-center justify-center text-white text-xs font-bold -ml-3">B</span>
  <span class="w-9 h-9 rounded-full bg-pink-500 border-2 border-white flex items-center justify-center text-white text-xs font-bold -ml-3">C</span>
  <span class="w-9 h-9 rounded-full bg-slate-300 border-2 border-white flex items-center justify-center text-slate-600 text-xs font-bold -ml-3">+9</span>
</div>

Free to use in personal and commercial projects. No attribution required.

Variants

Same component, different looks. Preview each one live and copy the code you like.

Small

Compact stack for table rows and comment headers with tight space.

A B C +9
Tailwind CSS

With status

Online indicators on each avatar for team presence in chat apps.

A B C
Tailwind CSS

Ring style

Colored rings instead of white borders for a bolder stacked look.

A B C
Tailwind CSS

About this avatar stack

Avatar stacks show the group: overlapping circles with a +9 overflow count. It is the collaboration pattern from Figma, Notion, and Google Docs, answering 'who else is here' at a glance.

The overlap uses negative margin (-ml-3) with white borders separating the circles. The final circle is the overflow count, not a person. When you lack real photos, gradient circles with initials work; real photos are better.

Order avatars by recency or relevance, not alphabetically. The overflow count should be accurate; '+9' when there are 9 more. Clicking the stack should reveal the full list.

Who else is here? is the constant background question in collaborative tools. A text list of names costs a full line; a row of individual avatars costs half the toolbar. The stack compresses the whole group into the width of two avatars: recognizable faces up front, a +N count for scale. It answers the question in a glance without spending layout the content needs.

A flex row of w-9 h-9 rounded-full circles, each after the first pulled over its neighbor with -ml-3. The border-2 border-white on every circle cuts a clean separation line so overlapping faces stay distinct. The final circle is not a person at all: a bg-slate-300 disc carrying the +N overflow count, which must be the true remainder, not an estimate.

Tune the density with the negative margin: -ml-2 for an airy stack, -ml-4 for a tight one. Cap the visible faces at three to five before the overflow count; beyond that, each face gets too little room to be recognizable. Give the overflow circle a hover ring and link it to the full member list, since curiosity about the hidden names is the point.

The mistake is dropping the separator borders to simplify the markup. Without the white ring between circles, adjacent avatars melt into a single blob and individual faces become unrecognizable, which destroys the recognition the stack exists for. Always keep the surface-colored ring between avatars; the two pixels of border are doing more work than they appear to.

Where to use it

  • ✓ Document collaborators
  • ✓ Team members
  • ✓ Event attendees
  • ✓ Project contributors

Customization tips

Size with w-8/w-10/w-12. Add hover:z-10 hover:scale-110 on each avatar for interactivity. The overflow circle can link to a full member list.

Design notes

When to use

Use it to answer who else is here at a glance: document collaborators, team members, and event attendees. The overlapping circles with an overflow count compress a whole group into a small space. Order avatars by recency so the most relevant faces show first.

What to avoid

Do not show an inaccurate overflow count; plus 9 must mean nine more, not roughly nine. Do not order alphabetically when recency matters more, since the first faces get the attention.

Accessibility

Give each avatar meaningful alt text with the person's name, and label the overflow count accessibly, like 9 more collaborators. If the stack is purely decorative, hide it from assistive tech instead.

Frequently asked questions

How do I overlap avatars?

Use negative left margin (-ml-3) on all but the first avatar, with white borders (border-2 border-white) to separate them.

How many avatars should I show?

Three to five, then an overflow count (+N). More avatars create clutter without adding information.

What if I do not have photos?

Use gradient backgrounds with initials. They look intentional and professional, unlike gray placeholder silhouettes.

How much should avatars overlap in a stack?

Overlap by about 25 to 30 percent of the avatar's width, which is -ml-3 on a 40px avatar. Too little overlap and the stack reads as a plain row; too much and faces disappear behind each other. The white ring between avatars also affects how the overlap reads, so test with the ring on.

How do I show a +5 more count in an avatar stack?

Cap the visible avatars at four or five, then add a final circle with the +N text styled like an avatar. Compute the hidden count in your code and render it as the last item. The count bubble usually gets a muted background so it reads as metadata rather than a person.

Should the hovered avatar come to the front of the stack?

Yes. Raise its z-index and lift it slightly with -translate-y-1 on hover. The hovered face popping forward is the standard interaction and helps in dense stacks where faces are mostly covered. Add a tooltip with the person's name if the stack represents real users.

Customize it with our tools