Skip to content
caliper ui pro docs

Branching thread

A conversation that keeps every version: editing a message or trying again starts a branch beside the original, ‹ 2 / 3 › moves between versions, and everything after follows the branch you choose.

Pro

Conversation

1 fork on this path
  1. Write a one-line subject for an email telling customers about our price change.
  2. Halden Assistant

    A heads-up about your Halden plan from 1 December.
  3. Make it calmer and say that most people pay the same.
  4. Halden Assistant

    From 1 December, most plans stay the same price. Here’s the detail.

When to use

  • Chat assistants where people refine questions.
  • Comparing answers without losing any.

When not to use

  • Support chat with a human; edits there should not fork.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/branching-thread

Adds its 8 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

activePath

0 props

No props of its own; it accepts the native props of its root element.

BranchingThread

5 props
PropTypeDefaultDescription
nodes *readonly ThreadNode[]—
onEdit((parentId: string | null, text: string) => void)—Add a new user message under `parentId` with this text; the reply is up to you.
onRegenerate((parentId: string) => void)—Add another answer under `parentId` (the user message).
assistantNamestring"Assistant"
classNamestring—

Keyboard

Escape
Closes or cancels, then returns focus to where it came from.
Enter
Activates the focused control.

Accessibility

It exposes group and status semantics, with aria-labelledby, aria-hidden and aria-label kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/branching-thread.md

The index of every part is at /llms.txt.

More in Assistant screens