# AnimatedTooltip

> Presence stack of overlapping avatars with a thin, dimmed ring each that lights up on hover or focus while the avatar lifts, its neighbours part to make room, and a glass name card rises, leaning toward the pointer, as one line of light sweeps under the name.

- Package: `fancy-ui-svelte` (Svelte 5 + Tailwind CSS v4)
- Category: Feedback
- Tags: tooltip, avatar, animation, hover, team
- Types: `AnimatedTooltipProps`, `TooltipItem`
- Docs: https://fancy-ui.rama.app/docs/components/animated-tooltip
- Source: https://github.com/RamaHerbin/fancy-ui/tree/main/src/lib/fancy-ui/animated-tooltip

## Import

```svelte
<script lang="ts">
  import { AnimatedTooltip } from 'fancy-ui-svelte';
</script>
```

Setup (once per project): `npm install fancy-ui-svelte`, then add `@import "fancy-ui-svelte/tailwind.css";` after `@import "tailwindcss";` in your main CSS file. Full guide: https://fancy-ui.rama.app/llms.txt

React: `import { AnimatedTooltip } from 'fancy-ui-react';` (`class` becomes `className`, snippets become `ReactNode`, DOM callbacks are camel-cased; exact names on https://fancy-ui.rama.app/docs/components/react/animated-tooltip.md).

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `items` (required) | `TooltipItem[]` | — | Array of items with id, name, designation, and image URL |
| `class` | `string` | — | Additional CSS classes for the container |
| `accent` | `string` | `undefined (theme-tuned lilac/ice iridescent pair)` | Tint of the presence ring and the light sweep under the name; any CSS colour. Writes --at-accent and a lighter --at-accent-2. |
| `size` | `number` | `56` | Avatar diameter in pixels; overlap, ring and pointer lean scale with it. |

## Examples

### Basic Usage

Presence stack on a nested-frame surface with the default iridescent ring.

```svelte
<script lang="ts">
	import { AnimatedTooltip, type TooltipItem } from "fancy-ui-svelte";

	const people: TooltipItem[] = [
		{
			id: 1,
			name: "John Doe",
			designation: "Software Engineer",
			image: "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=100&h=100&fit=crop",
		},
		{
			id: 2,
			name: "Jane Smith",
			designation: "Product Manager",
			image: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=100&h=100&fit=crop",
		},
		{
			id: 3,
			name: "Robert Johnson",
			designation: "UX Designer",
			image: "https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=100&h=100&fit=crop",
		},
		{
			id: 4,
			name: "Emily Brown",
			designation: "Data Scientist",
			image: "https://images.unsplash.com/photo-1580489944761-15a19d654956?w=100&h=100&fit=crop",
		},
	];
</script>

<div class="flex w-full justify-center p-6">
	<div
		class="w-full max-w-md rounded-[20px] border border-black/[0.08] bg-[#f4f4f5] p-1.5 dark:border-white/[0.08] dark:bg-[#0b0b0c]"
	>
		<div
			class="flex flex-col items-center gap-5 rounded-[14px] border border-black/[0.06] bg-[#fafafa] px-6 pt-20 pb-7 [--at-separator:#fafafa] dark:border-white/[0.06] dark:bg-[#141416] dark:[--at-separator:#141416]"
		>
			<AnimatedTooltip items={people} />
			<p class="flex items-center gap-2 text-xs text-black/50 dark:text-white/45">
				<span class="size-1.5 rounded-full bg-emerald-500/80" aria-hidden="true"></span>
				4 people in this file
			</p>
		</div>
	</div>
</div>
```

### Team Members

Custom accent and size: large avatars with a warm ring, small ones with a green ring.

```svelte
<script lang="ts">
	import { AnimatedTooltip, type TooltipItem } from "fancy-ui-svelte";

	const teamMembers: TooltipItem[] = [
		{
			id: "a",
			name: "Alex Chen",
			designation: "CEO & Founder",
			image: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=100&h=100&fit=crop",
		},
		{
			id: "b",
			name: "Sarah Wilson",
			designation: "CTO",
			image: "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=100&h=100&fit=crop",
		},
		{
			id: "c",
			name: "Michael Lee",
			designation: "Lead Developer",
			image: "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=100&h=100&fit=crop",
		},
	];

	const contributors: TooltipItem[] = [
		{
			id: "d",
			name: "Jane Smith",
			designation: "Product Manager",
			image: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=100&h=100&fit=crop",
		},
		{
			id: "e",
			name: "Robert Johnson",
			designation: "UX Designer",
			image: "https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=100&h=100&fit=crop",
		},
		{
			id: "f",
			name: "Emily Brown",
			designation: "Data Scientist",
			image: "https://images.unsplash.com/photo-1580489944761-15a19d654956?w=100&h=100&fit=crop",
		},
		{
			id: "g",
			name: "John Doe",
			designation: "Software Engineer",
			image: "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=100&h=100&fit=crop",
		},
	];
</script>

<div class="flex flex-col items-center gap-12 p-6 pt-20">
	<div class="flex flex-col items-center gap-3">
		<AnimatedTooltip items={teamMembers} size={72} accent="#f0a36e" />
		<span class="text-[11px] tracking-wide text-black/45 uppercase dark:text-white/40">
			Leadership · size 72 · warm accent
		</span>
	</div>
	<div class="flex flex-col items-center gap-3 pt-12">
		<AnimatedTooltip items={contributors} size={40} accent="oklch(0.72 0.12 165)" />
		<span class="text-[11px] tracking-wide text-black/45 uppercase dark:text-white/40">
			Contributors · size 40 · green accent
		</span>
	</div>
</div>
```
