JDS.

Search docs

Find a page or component

Branch

Step through versions of a response after regenerating. New versions are selected as they arrive.

Write a short reply confirming the refund.

Good news: we've issued your refund. Expect it within 3 to 5 business days.

2 / 2

Installation

pnpm dlx shadcn@latest add @jds/branch

Usage

import { Branch, BranchContent, BranchSelector } from "@/components/ai/branch"

<Branch count={versions.length}>
  <BranchContent>
    {versions.map((v) => <Response key={v.id}>{v.text}</Response>)}
  </BranchContent>
  <BranchSelector />
</Branch>

API Reference

Branch

PropTypeDefault
count

Number of versions. Growing it selects the newest.

number–
index

Controlled active version.

number–
onIndexChange(index: number) => void–