Skip to content
English

How it works

A list of round avatars that overlap and wear a ring in the surface colour, so they read as cut-outs on any background. They pop in one after another on a spring. Hovering or focusing one lifts it 4px with a soft shadow and raises it above its neighbours, and a dark tip shows the name and an optional role. The rest collapse into a “+N” chip whose tip lists the hidden names; with onMoreClick it becomes a button. Rows wrap when there is no room, keeping the overlap.

Use it for

  • Who is on a project, a document or a call, where the faces matter more than the full list.
  • Presence: who is viewing now, with online dots.

Look elsewhere when

  • When people need to read or act on every name: use a list.

Usage

import { AvatarGroup } from './AvatarGroup.jsx'

export function Members({ people, onShowAll }) {
  return (
    <AvatarGroup
      label="Project members"
      items={people.map((p) => ({ id: p.id, name: p.name, src: p.photo, status: p.role, online: p.online }))}
      max={4}
      size="md"
      onMoreClick={onShowAll}
    />
  )
}

Props

PropTypeDefaultWhat it does
items{ id?: string, name: string, src?: string, tone?: 1-8, status?: string, online?: boolean }[]—People in order. Without src the avatar shows initials on a soft tint; tone picks --ds-chart-N, otherwise it is derived from the name. status is the second line of the tip.
maxnumber4How many faces to show before the rest collapse into “+N”.
size'sm' | 'md' | 'lg' | number'md'28, 36 or 48px, or any pixel size.
spacing'tight' | 'loose''tight'Overlap of 22% or 6% of the size.
onMoreClick() => void—Makes “+N” a button, for example to show everyone.
label / moreLabelstring / (n, names) => string'People'Accessible name of the list (the count is appended) and of the “+N” chip.

Accessibility

  • The group is a list named with its label and count; each avatar is focusable and named with the person and status.
  • The tip appears on keyboard focus as well as hover; it is decorative because the name is already the accessible name.
  • “+N” announces how many are hidden and their names; with onMoreClick it is a real button.
  • Reduced motion removes the pop-in and the lift; tips only fade.

Motion

Entrance: 520ms spring scale from 0.6, 45ms stagger. Lift: 320ms spring. Tip: 160ms fade and a 220ms spring rise.

Add it to your project

Copy the prompt into Codex or Claude Code. The agent reads the published source, shows you what it will write and adds the component next to your own.

AvatarGroup.jsxavatar-group.csstokens.cssREADME.md

Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.

Data display
Code diff comes with Pro. Its preview shows once you unlock it.
Flip countdown comes with Pro. Its preview shows once you unlock it.