Components / Data
Animated Tooltip
An avatar stack whose tooltips spring up and sway with the cursor.
AK
SR
JL
TC
MD
Installation
Requires React 18+ and Tailwind CSS.
- 1
Install dependencies
$ npm install motion - 2
Add the component
Copy the code from the Code tab above into
components/ui/animated-tooltip.tsx. - 3
Use it
example.tsximport { AnimatedTooltip } from "@/components/ui/animated-tooltip"; const team = [ { id: 1, name: "Alex Kim", role: "Designer", color: "#f97316" }, { id: 2, name: "Sam Rivera", role: "Engineer", color: "#e11d48" }, { id: 3, name: "Jordan Lee", role: "Product", color: "#a855f7" }, { id: 4, name: "Taylor Chen", role: "Marketing", color: "#0ea5e9" }, { id: 5, name: "Morgan Diaz", role: "Founder", color: "#10b981" }, ]; export default function AnimatedTooltipDemo() { return <AnimatedTooltip people={team} className="pt-16" />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| people | { id; name; role?; avatar?: ReactNode; color? }[] | — | People to show. Without avatar, colored initials are used. |
| className | string | — | Leave room above (e.g. pt-16) for the tooltip. |