Components / Reasoning / Chain of Thought
Chain of Thought
A vertical trail of collapsible reasoning steps, connected by a line.
Installation
Install the Chain of Thought React component with the shadcn CLI (after adding the @ai-primitive registry and theme, see Installation):
npx shadcn@latest add @ai-primitive/chain-of-thought
Usage
import { ChainOfThought, ChainOfThoughtStep, ChainOfThoughtTrigger, ChainOfThoughtContent, ChainOfThoughtItem } from "@/components/ui/chain-of-thought"
Related components
- Reasoning - A collapsible "thinking" block that auto-opens while streaming and closes when done.
- Steps - A collapsible, numbered list of completed steps with a side rail.
- Tool - A collapsible tool-call card showing its state, input, output, or error.
- Source - An inline citation chip that opens a hover card with the linked page's details.