Components · Avatar
Avatar Group
StableAdded v0.0.1
Stacked group of avatars with overflow count.
import { AvatarGroup } from '@nexub/react';Playground
Props
spacing
<AvatarGroup max={3}>…</AvatarGroup>Examples
Default
States
defaultsize="sm"size="md"size="xs"size="lg"size="xl"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| max | number | — | Maximum number of avatars shown before an overflow count is rendered. |
| size | 'sm' | 'md' | 'xs' | 'lg' | 'xl' | 'md' | Controls avatar dimensions for all children. |
| spacing | 'sm' | 'md' | 'lg' | 'md' | Controls the overlap amount between stacked avatars. |
| childrenrequired | React.ReactNode | — |
Design tokens
Avatar Group reads these component tokens. Each one is unset by default and falls back to the semantic role it aliases, so nothing changes until you set it. Set one on any element to restyle every Avatar Group below it, and leave the roles other components share alone. See the three token tiers.
| Token | Aliases | Notes |
|---|---|---|
| --avatar-bg | --color-surface-container-high | — |
| --avatar-fg | --color-on-surface-muted | — |
| --avatar-radius | 9999px | A circle. |
/* One area of your app */
.checkout {
--avatar-bg: var(--color-secondary);
}On iOS & Android: AvatarGroup
@nexub/react-nativeAlpha
import { AvatarGroup } from '@nexub/react-native';
<AvatarGroup max={3}>{people.map((p) => <Avatar key={p.id} name={p.name} />)}</AvatarGroup>Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
AvatarGroup props
| Prop | Type | Default | Description |
|---|---|---|---|
| childrenrequired | React.ReactElement<AvatarProps>[] | — | — |
| max | number | 4 | Avatars shown before "+N". |
| size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | — | — |
| spacing | 'sm' | 'md' | 'lg' | 'md' | How much the avatars overlap: sm is tight, lg barely overlaps. |