Skip to content

AvatarGroup

Displays a stacked group of Avatars with shared size and overlap.

<AvatarGroup {...args}>
<Avatar name="Ada Lovelace" src="https://i.pravatar.cc/256?img=47" />
<Avatar name="Grace Hopper" src="https://i.pravatar.cc/256?img=32" />
<Avatar name="Katherine Johnson" />
</AvatarGroup>
+4
<AvatarGroup {...args}>
<Avatar name="Ada Lovelace" src="https://i.pravatar.cc/256?img=47" />
<Avatar name="Grace Hopper" src="https://i.pravatar.cc/256?img=32" />
<Avatar name="Katherine Johnson" />
<AvatarGroupOverflow count={4} />
</AvatarGroup>
<AvatarGroup {...args}>
<Avatar name="Ada Lovelace" />
<Avatar name="Grace Hopper" />
<AvatarGroupOverflow count={8} onClick={() => undefined} />
</AvatarGroup>
+4
+4
+4
+4
+4
<div style={{display: 'flex', flexDirection: 'column', gap: 16}}>
{(['tiny', 'xsmall', 'small', 'medium', 'large'] as const).map(size => (
<AvatarGroup aria-label={`${size} group`} key={size} size={size}>
<Avatar name="Ada Lovelace" />
<Avatar name="Grace Hopper" />
<Avatar name="Katherine Johnson" />
<AvatarGroupOverflow count={4} />
</AvatarGroup>
))}
</div>
+5
+5
+5
<div style={{display: 'flex', flexDirection: 'column', gap: 16}}>
{([24, 48, 96] as const).map(size => (
<AvatarGroup aria-label={`${size}px group`} key={size} size={size}>
<Avatar name="Ada Lovelace" />
<Avatar name="Grace Hopper" />
<AvatarGroupOverflow count={5} />
</AvatarGroup>
))}
</div>
View all
<AvatarGroup {...args}>
<Avatar name="Ada Lovelace" />
<Avatar name="Grace Hopper" />
<AvatarGroupOverflow count={12}>View all</AvatarGroupOverflow>
</AvatarGroup>
<AvatarGroup
{...args}
data-analytics="member-group"
id="member-group"
onMouseEnter={() => undefined}
title="Project members">
<Avatar name="Ada Lovelace" />
<Avatar name="Grace Hopper" />
<AvatarGroupOverflow
count={4}
data-analytics="member-overflow"
onClick={() => undefined}
title="View all members"
/>
</AvatarGroup>

Displays a stacked group of Avatars with shared size and overlap.

PropTypeDefaultDescription
aria-labelstringAccessible label for the group. Default is "Avatars".
children*ReactNodeAvatar and AvatarGroupOverflow children.
classNamestringAdditional CSS class names applied to the root element.
data-testidstringTest ID applied to the root element.
refRef<HTMLDivElement>Ref forwarded to the root element.
size"small" | "tiny" | "xsmall" | "medium" | "large" | 16 | 20 | 24 | 32 | 36 | 40 | 48 | 60 | 64 | 72 | 96 | 128 | 144 | 180Size applied to child Avatars. Individual Avatar size props are ignored while inside the group so the stack remains visually consistent.
styleCSSPropertiesInline styles applied to the root element.

Overflow indicator showing the count of hidden avatars in an AvatarGroup.

PropTypeDefaultDescription
childrenReactNodeCustom content rendered instead of the default "+N" text.
classNamestringAdditional CSS class names applied to the root element.
count*numberNumber of hidden avatars represented by the overflow indicator.
data-testidstringTest ID applied to the root element.
onClickMouseEventHandler<HTMLButtonElement>Click handler. When set, the overflow indicator renders as a button.
refRef<HTMLElement>Ref forwarded to the root element.
styleCSSPropertiesInline styles applied to the root element.