# Presence fan

A presence stack that fans open like a hand of cards.

Also called: avatar group animation, avatar fan.

> chatcn Pro: needs a Pro license (https://chatcn.dev/pro). Install from the `@chatcn-pro` registry with your license token; setup at https://chatcn.dev/docs/chatcn-pro.

Example: A stack that fans like cards. Hover the stack and the faces deal out into an arc on springs, each with its cursor colour and name tag; hover a face and it lifts. Preview: https://chatcn.dev/preview/presence-fan-demo

Closed, it is the usual overlapping row of faces and a +3. Hover or focus it and the faces deal out on springs into an arc above, centre out, each taking a ring in its live cursor colour and a name tag like the cursors on a shared canvas, and the +3 deals out the people it was hiding. Hover a face and it lifts and its tag grows to the full name. It folds back outside in, a little quicker. Who is here is good to know when people and agents share a document.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/presence-fan
```

## Usage

```tsx
import { PresenceFan } from "@/components/ui/chatcn/pro/presence-fan"

<PresenceFan people={viewers} action={<ShareButton />} />
```

Leave room above the stack for the fan, about 240 px.

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `people` | `{ id, name, initials, color }[]` | `color` is their cursor colour |
| `shown` | `number` | Faces before the +N; default 5 |
| `action` | `ReactNode` | After the count |
| `open` / `onOpenChange` | `boolean` | Optional control |
| `highlighted` | `string | null` | Lift a face from outside |

## Accessibility

- Everyone viewing is also listed for screen readers; the fan itself is decoration.

## Motion

- Opens with a 35 ms stagger on a spring with a small overshoot, closes outside in at 22 ms. Reduced motion: faces fade in place.

Source: https://chatcn.dev/docs/components/presence-fan