AvatarGroup
<AvatarGroup>TailwindCSS ModulesDisplays multiple avatars stacked together horizontally. Used for showing multiple contributors, active viewers, or group membership, with automatic +N overflow bubbling.
npx coloxo add avatar-group --style coloxo-cssimport { AvatarGroup } from '@coloxo/ui';Design Tokens:
1. Variant Matrix
Different combinations of AvatarGroups using images, initials, and overflow limits.
| Images (Max 3) | Initials (Max 4) | No Overflow (Max 10) | With Border | |
|---|---|---|---|---|
| Group | +1 |
2. Control heights (Sizes)
The AvatarGroup inherits the same 6 standard sizes as the standalone Avatar component.
Sizes
size="xs"Dense tables, inline avatars
size="sm"Secondary lists, compact toolbars
size="md"DEFAULTStandard forms, page headers
size="lg"Hero sections, primary cards
3. Interactive Props Configurator
Use Initials
border
<AvatarGroup max={4} items={[ { src: "https://i.pravatar.cc/150?u=a042581f4e29026704a" }, { src: "https://i.pravatar.cc/150?u=a042581f4e29026704b" }, { src: "https://i.pravatar.cc/150?u=a042581f4e29026704c" }, { src: "https://i.pravatar.cc/150?u=a042581f4e29026704d" }, { src: "https://i.pravatar.cc/150?u=a042581f4e29026704e" }, { src: "https://i.pravatar.cc/150?u=a042581f4e29026704f" } ]}/>4. Dark theme
AvatarGroups automatically update their stack ring shadow color to match dark mode backgrounds.
5. Enterprise layout compositions
AvatarGroups are frequently used in task headers, active user indicators, and comment threads.
Active Contributors
Accessibility
The root div uses role='group' to announce the collection of avatars together.
The overflow bubble uses an aria-label (e.g., '3 more') to ensure screen readers announce the numeric summary instead of just '+3'.
Always provide 'alt' text in the items array for image avatars to ensure users know who is present in the group.
Props
| Name | Type | Default | Description |
|---|---|---|---|
| items | AvatarGroupItem[] | — | Avatar entries. |
| max | number | 5 | Visible avatars before +N. |
| size | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | md | Avatar size. |