- Docs
- Components
- Data display
Avatar group
A few people at a glance, then +N. One image to a screen reader, named in full.
- Import
- @qeetrix/react/experimental
- Status
- ExperimentalSince 0.0.8
- Renders
<span role="img">Server-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Import
// Experimental: from the package's experimental entry, until it's stable.
import { AvatarGroup } from "@qeetrix/react/experimental";02
Props
And every native attribute of the element it renders.
| Prop | Type | Default | What it does |
|---|---|---|---|
people | { name, src? }[] | required | The people, or the first few when total is larger. |
max | number | 3 | How many show before +N. |
total | number | people.length | How many there are in all: a group's 412 members. |
size · shape | AvatarSize · AvatarShape | "sm" · "circle" | sm fits a table row; square for organisations and applications, with a square +N. |
locale · messages | string · object | the provider's | The counts and the list of names; label is "{count} people: {names}". |
03
Parts
Each part carries a data-slot, for tests and placement.
| data-slot | Element | What it is |
|---|---|---|
avatar-group | <span role="img"> | aria-label: the count and the names. |
avatar | <span> | Each Avatar, decorative inside the group. |
avatar-group-more | <span> | +N, aria-hidden. |
04
From a paged API
Pass the first page's people and the API's total: the name says how many in all.
const { data } = useGroupMembers(group.id, { limit: 3 });
<AvatarGroup people={data.members} total={data.total} />