Avatar Group
Overlapping avatars, overflow counts, and social proof using the shared avatar primitives.
View codeHide code
import {
Avatar,
AvatarFallback,
AvatarGroup,
AvatarGroupCount,
} from "@/components/ui/avatar";
const TEAM = [
{ id: "janaki", name: "Janaki", palette: ["#dff4ff", "#38bdf8"] },
{ id: "vikram", name: "Vikram", palette: ["#fff0e2", "#fa9769"] },
{ id: "kalpana", name: "Kalpana", palette: ["#e7fbe8", "#9ce786"] },
] as const;
export function AvatarGroupExample() {
return (
<AvatarGroup aria-label="Project team">
{TEAM.map((member) => (
<Avatar key={member.id}>
<AvatarFallback alt="" name={member.name} palette={member.palette} />
</Avatar>
))}
<AvatarGroupCount count={4} />
</AvatarGroup>
);
}Installation
Groups are included in the Avatar component.
npx shadcn@latest add @blobz/avatarUsage
import { Avatar, AvatarFallback, AvatarGroup, AvatarGroupCount } from "@/components/ui/avatar";
<AvatarGroup aria-label="Project team">
<Avatar><AvatarFallback name="Janaki" palette={["#dff4ff", "#38bdf8"]} /></Avatar>
<Avatar><AvatarFallback name="Vikram" palette={["#fff0e2", "#fa9769"]} /></Avatar>
<Avatar><AvatarFallback name="Kalpana" palette={["#e7fbe8", "#9ce786"]} /></Avatar>
<AvatarGroupCount count={4} />
</AvatarGroup>Each avatar has its own palette and accepts an optional AvatarImage. Match frame and size on the count to the avatars around it. Overlap follows the document direction.
Social proof
Compose a group with supporting copy. The avatars and text stay separate, so either can be adapted to your layout.
Made for your people. A face for every profile.
View codeHide code
import { Avatar, AvatarFallback, AvatarGroup } from "@/components/ui/avatar";
const PEOPLE = [
{ name: "Janaki", palette: ["#dff4ff", "#38bdf8"] },
{ name: "Vikram", palette: ["#fff0e2", "#fa9769"] },
{ name: "Kalpana", palette: ["#e7fbe8", "#9ce786"] },
] as const;
export function AvatarSocialProofExample() {
return (
<div className="flex flex-wrap items-center justify-center gap-4">
<AvatarGroup aria-label="Community members">
{PEOPLE.map(({ name, palette }) => (
<Avatar frame="circle" key={name} size="sm">
<AvatarFallback alt="" name={name} palette={palette} />
</Avatar>
))}
</AvatarGroup>
<p className="text-muted-foreground text-sm">
<span className="font-medium text-foreground">
Made for your people.
</span>{" "}
A face for every profile.
</p>
</div>
);
}API
AvatarGroup accepts div props. Give it an accessible label describing the people represented.
AvatarGroupCount accepts span props, frame, size, and an optional numeric count. It labels a positive count as “N more people”; zero, negative, and non-finite counts are hidden. Supply children and an aria-label for a custom icon or action label.