# Thinking handoff

Thinking hands over to the answer: the steps fold into a header and the answer writes in below.

Also called: thinking 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: Thinking hands over to the answer. While the model thinks, its steps tick past above a live timer. When the answer starts, the steps fold into the header, the label lifts and shrinks into it, and the answer writes in below. Preview: https://chatcn.dev/preview/thinking-handoff-demo

While the model thinks, its latest steps tick past above a shimmering Thinking and a running timer. When the answer starts, the steps fold up into a quiet Thought for 6s header, the label lifts and shrinks into it, and the answer writes in below. The header stays as the way back into the reasoning.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/thinking-handoff
```

## Usage

```tsx
import { ThinkingHandoff } from "@/components/ui/chatcn/pro/thinking-handoff"

<ThinkingHandoff thinking={!answerStarted} thoughts={steps}>
  {answer}
</ThinkingHandoff>
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `thinking` | `boolean` | Flip it when the answer starts |
| `thoughts` | `string[]` | One line per step |
| `children` | `ReactNode` | The answer |

## Accessibility

- Thinking is a status; the header is a button with `aria-expanded` that opens the full steps.

## Motion

- The label is one FLIP, 460 ms; the steps fold 380 ms; the answer reveals with a `clip-path`. Reduced motion: it swaps.

Source: https://chatcn.dev/docs/components/thinking-handoff