Components
Avatar Stack
Stacked avatars with names on hover.
- AL
- AT
- GH
- KJ
- LT
- +2
<AvatarStack people={people} />Installation
npx shadcn@latest add https://ui.zjkm.tech/r/avatar-tooltip.jsonimport { AvatarStack } from "@/components/avatar-tooltip"Using JavaScript? Set tsx: false in components.json and the CLI converts it.
New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.
Usage
Overlapping avatars, each lifting and showing its name on hover, with "+N" for anyone past max. Every avatar is an image named after its person, so screen readers read the whole list.
import { AvatarStack } from "@/components/avatar-tooltip";
const people = [
{ name: "Ada Lovelace", src: "/ada.jpg" },
{ name: "Alan Turing", color: "#0369a1" },
];
export function Collaborators() {
return <AvatarStack label="Editing now" people={people} />;
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
people | { name, src?, color? }[] | The people. Without a photo, initials are shown. | |
max | number | 5 | Shown before "+N". |
size | number | 36 | Avatar size in pixels. |
label | string | "People" | Accessible name of the list. |
className | string | Classes for the list. |
With reduced motion, avatars don't lift on hover.