Branch fork (Pro)
ProIncluded in $99Forking a conversation drawn as it happens: a new lane bends out of the message's node and runs down to a fresh row.
On this page
ProBranch from any message: a new lane bends out of its node and runs down to a fresh row, and the messages it leaves behind dim.
Every message is a node on the thread's rail. Pick Branch on one and a new lane bends out of that node and runs down beside the rail to a new row; the messages it leaves behind dim to show they stay on the old line. Branch somewhere else and the lane grows from the new node instead. The new row takes any children, usually a composer.
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 { BranchFork } from "@/components/ui/chatcn/pro/branch-fork"
<BranchFork messages={map} forkAt={forkAt} onFork={setForkAt} branchLabel="Try a SharedWorker">
<Composer />
</BranchFork>Props
| Prop | Type | Notes |
|---|---|---|
messages | { id, role: "user" | "assistant", text }[] | One line each: the thread as a map |
forkAt | string | null | The message the branch grows from |
onFork | (id: string | null) => void | Shows Branch on rows and Back to main |
branchLabel | string | Default "New branch" |
children | ReactNode | Under the branch label |
Accessibility
- The map is an ordered list. Branch buttons show on hover and focus, always on touch.
- The new row is
inertuntil a branch exists.
Motion
- The lane draws with
stroke-dashoffset, 520 ms ease in out; the new node pops at the end. - Reduced motion: the lane and node appear at once.