Avatar Stack
FreeOverlapping avatars that lift on hover and show a springy tooltip.
Installation
pnpm dlx shadcn@latest add @viewport/avatar-stack
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above.
import { AvatarStack } from "@/components/viewport/avatar-stack";
const people = [
{ name: "Ines Moreau", role: "Design engineer" },
{ name: "Theo Park", role: "Staff engineer" },
{ name: "Amara Okafor", role: "Founder" },
{ name: "Jonas Weber", role: "Product designer" },
{ name: "Lea Fontaine", role: "Frontend lead" },
{ name: "Sam Rivera" },
{ name: "Kit Nakamura" },
];
export default function AvatarStackDemo() {
return (
<div className="flex flex-col items-center gap-3 pt-10">
<AvatarStack people={people} />
<p className="text-sm text-muted-foreground">Trusted by teams who care about detail.</p>
</div>
);
}Props
| Prop | Type | Default |
|---|---|---|
| people* | Person[] | — |
| max | numberShow at most this many, then a "+N" chip. | 5 |
| size | numberAvatar diameter in pixels. | 40 |
| className | string | — |
Accessibility
- A list of labelled buttons; tooltips show on keyboard focus.
- Falls back to initials when no image is provided.
- The overflow chip announces how many more.