Regenerate stack (Pro)
ProIncluded in $99Answer versions as a deck: regenerate and the old answer slips back into a stack behind the new one, and stepping through brings each card forward.
On this page
Regenerate usually makes the answer you had disappear behind a 2 / 2 counter. Here it slips back and up into a deck behind the new one, its edge still showing, so you can see you kept it. Every version is a card in the same deck: stepping through brings that card forward while the others settle behind it in order of distance, and the count rolls with them. A version still being written shows the Thinking style label over skeleton lines.
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 { RegenerateStack } from "@/components/ui/chatcn/pro/regenerate-stack"
<RegenerateStack
versions={versions}
index={index}
onIndexChange={setIndex}
onRegenerate={regenerate}
/>Props
| Prop | Type | Notes |
|---|---|---|
versions | { id, content: ReactNode | null }[] | null content while that version is being written |
index | number | The version in front |
onIndexChange | (index: number) => void | |
onRegenerate | () => void | Shows the Regenerate button |
pendingLabel | string | Default "Writing another version" |
Accessibility
- Only the front card is in the accessibility tree; cards behind are
inert. - The count is announced politely as it changes.
Motion
- Cards move on
translate,scaleandopacityonly, 380 ms. Up to two edges peek, 8 px apart. - The deck eases to the front card's height, measured live so a streaming version grows the deck with it.
- The regenerate icon makes one full turn per press. Reduced motion keeps the fades.