Design System
Data display

Avatar group

Several avatars overlapped into one cluster, with a plus-N count once they exceed the limit.

Purpose

An avatar group answers "who is involved?" at a glance — the reviewers on a claim, the members on a corporate plan, the team behind a benefit group. It takes a flat list of people and does the composition itself: overlap, initials fallback, and the "+N" chip once the list exceeds max.

For one person, use Avatar. Never overlap avatars by hand — the group owns the ring, spacing and overflow logic, so hand-rolled clusters drift the moment any of those change.

Example

Give it items — a name, and a src when a photo is on file. Initials are derived from the name automatically (first letter of the first two words).

ARLWPN
Reviewers on a claim
import { AvatarGroup } from "@healthmetrics/ui/avatar-group";

<AvatarGroup
  items={[
    { name: "Aisyah Rahman", src: "/avatars/aisyah.jpg" },
    { name: "Lim Wei Jie" },
    { name: "Priya Nair" },
  ]}
/>

Overflow

Beyond max (default 4), the rest collapse into a "+N" chip. Hovering the chip shows the hidden names in a native tooltip.

ARLWPNTM+3: Ahmad Faiz, Sarah Wong, Rajesh Kumar

size sets the avatar diameter in pixels when 32px is too small for the context:

ARLWPN

Structure

The tokens behind the cluster.

PropertyValue
Diameter32px default, set per-group with size
Overlap8px (-ml-2) on every avatar after the first
Separation2px ring in --background, so overlaps stay legible on any fill
Initials12px (text-xs), first letters of the first two words, uppercased
Overflow chipsame diameter, --muted fill, 12px semibold --muted-foreground

Best practices

Do

  • Order items by relevance — everything past max disappears into the chip.
  • Keep max modest; a row of ten avatars is a list, not a glance.
  • Provide src when a photo exists — the initials fallback covers the rest automatically.
  • Pair the group with a full, readable list (a popover, a detail panel) wherever the complete membership actually matters.

Don't

  • Compose overlapping Avatars by hand — the group exists so the ring, overlap and overflow stay consistent.
  • Use it for organisations, clinics or documents — avatars signal people.
  • Shrink size below 24px; two initials stop being legible.
  • Treat the chip as the only visible record of who is hidden — sighted keyboard and touch users never see its tooltip, even though screen readers hear the names.

Accessibility & keyboard

  • Photos render with alt set to the person's name; the initials fallback is read as literal text, so every visible person is announced.
  • The "+N" chip announces the hidden names to screen readers ("+2: Kavitha Pillai, Daniel Ong") via visually hidden text; the native title tooltip remains as the pointer affordance. Sighted keyboard and touch users still cannot see the hidden names, so when the exact membership is load-bearing, present the full list somewhere persistent too.
  • The group renders a plain <div> — no list semantics, no role. When the exact membership is load-bearing, present it as a real list nearby.
  • Keyboard: none — the group is non-interactive. If clicking it should open the full list, wrap it in a button that owns the focus and the name.

Props

PropTypeDefaultDescription
itemsrequiredAvatarGroupItem[]——
maxnumber | undefined4Avatars shown before collapsing the rest into a “+N” count.
sizenumber | undefined32Avatar diameter in pixels.

Each entry in items:

PropTypeDefaultDescription
srcstring | undefined—Image URL; initials fallback is used when absent or failing.
namerequiredstring—Full name — used for the tooltip title and initials fallback.
Avatar group in Storybook

On this page