Remember flight (Pro)
ProIncluded in $99Memories you can see being kept: the words tint, a slip of them arcs into the header's memory button, and the count rolls.
On this page
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
Needs chatcn Pro
This command works with a Pro license, along with every Pro component.
Or start free: sign up and get three Pro components on us, with a new one every month.
Usage
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
flySliparc fromchatcn-micro, 620 ms, on the compositor. - The count rolls with the Pro number flow; the label edits with the Pro text morph.