# Summarize squeeze

A document that summarises itself: paragraphs press into gray bars and the summary points rise out of them.

Also called: summarize animation.

> 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 document that summarises itself. Each paragraph presses into a gray bar, the page closes up, and the summary points rise out of the bars. Going back plays it in reverse. Preview: https://chatcn.dev/preview/summarize-squeeze-demo

Each paragraph presses down into a thin gray bar, top first, the page closes up to the height of what remains, and the summary points rise out of the bars one by one, their words drawn in from the start. Going back plays it in reverse. Heights are measured, so text of any length squeezes cleanly.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/summarize-squeeze
```

## Usage

```tsx
import { SummarizeSqueeze } from "@/components/ui/chatcn/pro/summarize-squeeze"

<SummarizeSqueeze paragraphs={doc} summary={points} mode={mode} />
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `paragraphs` | `string[]` | The full text |
| `summary` | `string[]` | The points |
| `mode` | `"full" | "summary"` | Change it to play |

## Accessibility

- The hidden version is `aria-hidden`, so only the visible text is read.

## Motion

- Press: `scaleY` to 0.14 with a bar fading in, 45 ms apart. The box height eases 380 ms. Points rise 70 ms apart with a `clip-path` reveal of their words.
- Reduced motion: a crossfade.

Source: https://chatcn.dev/docs/components/summarize-squeeze