Chain of Thought

Collapsible reasoning steps with active streaming and complete states.

Analyzing query...
Formulating response...

Installation

npx shadcn add https://ui.adq.ai/api/r/chain-of-thought

Usage

import {
  ChainOfThought,
  ChainOfThoughtHeader,
  ChainOfThoughtContent,
  ChainOfThoughtStep,
} from "@/components/ai-elements/chain-of-thought";

function ThinkingBlock() {
  return (
    <ChainOfThought>
      <ChainOfThoughtHeader>Chain of thought</ChainOfThoughtHeader>
      <ChainOfThoughtContent>
        <ChainOfThoughtStep
          label="Analyzing the user query..."
          status="complete"
        />
        <ChainOfThoughtStep
          label="Formulating response..."
          status="active"
        />
      </ChainOfThoughtContent>
    </ChainOfThought>
  );
}

Props

PropTypeDefaultDescription
openbooleanControlled open state of the collapsible.
defaultOpenbooleanfalseDefault open state (uncontrolled).
onOpenChange(open: boolean) => voidCallback when open state changes.