Components
AvatarGroup displays multiple avatars in an overlapping row with an optional overflow indicator, from Meta's Astryx design system. Uses a compositional API: pass Avatar children directly so each avatar can carry its own props (status dots, click handlers, etc.). Includes AvatarGroupOverflow for +N counts or custom overflow content.
npx @21st-dev/cli add Astryxdesign/astryx-avatar-groupLoading preview...
'use client';
import AvatarGroup, {
AvatarGroupOverflow,
} from '@/components/ui/astryx-avatar-group';
import {Theme} from '@astryxdesign/core/theme';
import {neutralTheme} from '@astryxdesign/theme-neutral/built';
import {Avatar} from '@astryxdesign/core/Avatar';
import {Stack} from '@astryxdesign/core/Layout';
import {Text} from '@astryxdesign/core/Text';
const USERS = [
{
name: 'Alex Daniels',
key: 'alex',
},
{
name: 'Ann Smith',
key: 'ann',
},
{
name: 'Carol Davis',
key: 'carol',
},
{
name: 'Gina Wilson',
key: 'gina',
},
{
name: 'Eve Park',
key: 'eve',
},
];
export default function AvatarGroupShowcase() {
return (
<Theme theme={neutralTheme}>
<div
style={{
minHeight: '100dvh',
display: 'grid',
placeItems: 'center',
padding: 24,
}}>
<Stack direction="vertical" gap={8}>
<Stack direction="vertical" gap={3}>
<Text type="supporting" color="secondary">
Team members
</Text>
<AvatarGroup size="medium">
{USERS.map(u => (
<Avatar key={u.key} name={u.name} />
))}
</AvatarGroup>
</Stack>
<Stack direction="vertical" gap={3}>
<Text type="supporting" color="secondary">
With overflow
</Text>
<AvatarGroup size="medium">
{USERS.slice(0, 3).map(u => (
<Avatar key={u.key} name={u.name} />
))}
<AvatarGroupOverflow count={USERS.length - 3} />
</AvatarGroup>
</Stack>
</Stack>
</div>
</Theme>
);
}
Loading preview...
Loading preview...
Loading preview...