Avatar Group
AvatarGroup displays multiple Avatar components in a compact horizontal stack of overlapping avatars, representing users, entities or objects. When space is limited, an AvatarGroupCount indicates how many members are hidden.
| Salt package | @salt-ds/lab |
|---|---|
| Available since | 1.0.0-alpha.103 |
In a non-interactive avatar group, ensure each Avatar has a meaningful accessible name so screen reader users can identify individual members.
A non-interactive avatar group is exposed with role="group". Give it an accessible name with aria-label (for example, “Team members”) so screen reader users know what the avatars have in common, as the role conveys little on its own.
When an avatar group is interactive, its accessible name replaces the names of the avatars it contains, so provide a descriptive one (for example, “Team members”) so screen reader users understand what action will occur when it is activated.
When you use the render prop, the group role isn’t applied, so the element you provide keeps its own semantics — a button is announced as a button rather than a group.
The count indicator is an AvatarGroupCount. Its required count prop renders the visible “+3” and provides the accessible name “3 more”.