Skip to content

AvatarGroup

Stack of avatars representing a collection of users, with optional overflow tile and shared sizing.

  • stable
  • since v0.1.0
  • 1.93 kB
  • feedback
  • identity
  • user

Renders a <div> wrapper around child avatars; each Avatar retains its own name for screen readers. The overflow tile uses aria-label to announce hidden members.

Preview
Open
tsx

Use max to cap how many avatars render inline. Excess avatars collapse into a +N overflow tile that is automatically labelled for assistive tech.

Preview
Open
tsx

The group’s size cascades to every child avatar (children may still override individually).

Preview
Open
tsx

ring is on by default to separate stacked avatars; pass ring={false} to disable. Use shape to switch between circle (default), rounded, and square tiles.

Preview
Open
tsx

renderOverflow lets you swap the default +N tile for a fully custom node — useful for buttons that open a member list.

Preview
Open
tsx
PropTypeDefaultDescription
size
"xs"|"sm"|"md"|"lg"|"xl"|"2xl"
md
Size applied to every child avatar via context. One of `xs`, `sm`, `md`, `lg`, `xl`, `2xl`.
shape
"circle"|"square"|"rounded"
circle
Shape applied to the overflow tile and used as the visual default. One of `circle`, `square`, `rounded`.
ring
boolean
true
Render a halo ring on each child avatar so overlap reads cleanly.
max
number
Maximum number of child avatars to render inline. Excess avatars collapse into a `+N` overflow tile.
renderOverflow
((count: number) => ReactNode)
Render override for the overflow tile. Receives the hidden count.
  • Each child Avatar should carry a name so screen readers can announce membership individually.
  • The overflow tile sets aria-label="{N} more" so assistive tech reports the hidden count.
  • Avoid stacking more than a handful of avatars without a max — long stacks become noisy to navigate.
  • When the group represents a list, wrap it in a labelled landmark (<section aria-label="Collaborators">).
  • Use max={3} or max={5} to keep dense rosters compact.
  • Pair each avatar with a Tooltip so full names are accessible on hover and focus.
  • Pass renderOverflow={(n) => <button>+{n}</button>} to make the overflow tile open a member dialog.
  • Set ring={false} on backgrounds where the default ring colour blends in.