# Remember flight

Memories you can see being kept: the words tint, a slip of them arcs into the header's memory button, and the count rolls.

Also called: save memory 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: Remember this. Pick a fact to remember: the words tint, a slip of them arcs into the header's memory button, which turns purple, the count rolls and it says what it kept. Preview: https://chatcn.dev/preview/remember-flight-demo

Saving a memory is usually a toast nobody reads. Here the exact words tint like a selection, a slip of them lifts out of the message and arcs into the memory button in the header. The button takes it with a small squeeze and turns memory's purple, the count rolls up, and for a moment it says what it kept before settling back to the count.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/remember-flight
```

## Usage

```tsx
import { flyToMemory, MemoryButton } from "@/components/ui/chatcn/pro/remember-flight"

const memory = React.useRef<HTMLButtonElement>(null)

async function remember(el: HTMLElement, text: string) {
  await flyToMemory(el, memory.current!, text)
  setCount((c) => c + 1)
  setSaved({ id: crypto.randomUUID(), text })
}

<MemoryButton ref={memory} count={count} saved={saved} />
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `count` | `number` | Saved memories |
| `saved` | `{ id, text } | null` | Each new value shows it for a moment |
| `label` | `string` | Default "Memory" |
| `showMs` | `number` | How long a new memory shows. Default 2400 |

`flyToMemory(from, to, text)` resolves when the slip lands, which is the moment to bump the count. Under reduced motion it resolves at once.

## Accessibility

- The button announces Saved to memory with the text, politely.
- The slip is decorative and `aria-hidden`.

## Motion

- The slip uses the shared `flySlip` arc from `chatcn-micro`, 620 ms, on the compositor.
- The count rolls with the Pro number flow; the label edits with the Pro text morph.

Source: https://chatcn.dev/docs/components/remember-flight