# Citation bloom

A citation that opens where it sits: the raised footnote number grows into its source card, starting from the number's own box.

Also called: citation animation, expanding citation.

> 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: Citations that open in place. Rest on a footnote number and it grows into its source card, starting from the number's own box; leaving folds it back. Preview: https://chatcn.dev/preview/citation-bloom-demo

Rest on the small raised footnote number in a sentence, focus it or tap it, and the number itself grows into the source card: the card's outline starts as the number's own box and opens out to full size, and the site, title and quoted passage settle in once there is room. Leaving folds it back into the number. Near the right edge it opens leftward.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/citation-bloom
```

## Usage

```tsx
import { CitationBloom } from "@/components/ui/chatcn/pro/citation-bloom"

<p>
  Rotating refresh tokens work once
  <CitationBloom index={1} source={{ title, url, quote }} />
</p>
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `index` | `number` | The footnote number |
| `source` | `{ title, url, site?, quote?, icon? }` |  |
| `open` / `onOpenChange` | `boolean` / `(open) => void` | Controlled, for tours |

## Keyboard

| Key | Action |
| --- | --- |
| `Tab` | Focus the chip, which opens it |
| `Enter` / `Space` | Toggle |
| `Escape` | Close |

## Accessibility

- The chip is a button named Source 1 with the title, with `aria-expanded`; the card is a `note` with a real link.
- Hover opens after 120 ms and closes after 160 ms, so passing over text does not flash cards.

## Motion

- The bloom is a `clip-path` inset from the number's box to the card's, 300 ms; content fades in 110 ms later. Folding is 200 ms.
- Reduced motion: a short fade.

Source: https://chatcn.dev/docs/components/citation-bloom