Base JS behaviour

Avatar group

An overlapping row of teammates with a +n counter and a name tooltip on each avatar.

Real scenarios

The component as it is used in a product — not a specimen grid.

Who has the document open

The header of a shared file: the ceiling max="4" folds the room into +n, hovering — or tabbing to — a face reveals its name, and the whole strip answers as one aria-labelled group.

Release notes · v2.4 7 people in this file right now

Four of the seven shown, three folded away. A src per person seats the real face; the initials stay underneath as the fallback.

The crew on a project card

size="sm" for tight rows: the group rides the card footer beside its own member count, and max="4" keeps the footer one line tall.

Shop billing Due Thursday

3 open issues · last deploy: 2 days ago

9 members

The weekly review’s guests

size="lg" when the row has room, and a ceiling above the list’s length shows everyone — so no +n appears at all.

Every face is a tab stop with its name as the tooltip — the group label names the gathering for screen readers.

Important props

Important props
Prop Type Default What it does
people array [] A list of [['name' => …, 'src' => …], …].
max int 5 Shown ceiling; the rest folds into +n. A ceiling above the list’s length shows everyone.
size string md One size for every avatar: xs · sm · md · lg · xl — sm for tight card rows.
label string null The aria label for role="group"; tells screen readers what the row gathers.

Snippet

<x-nx::avatar-group
    :people="[['name' => 'نگار رستمی'], ['name' => 'Kenji Sato'], ['name' => 'لیلا حداد']]"
    :max="2"
    size="sm"
    label="تیم محصول"
/>