Components
Collapsible component that visualizes AI reasoning as step-by-step thinking with status indicators, search results, and images.
Loading preview...
import {
AiChainOfThought,
AiChainOfThoughtHeader,
AiChainOfThoughtContent,
AiChainOfThoughtStep,
AiChainOfThoughtSearchResults,
} from "@/components/ui/chain-of-thought";
export default function ChainOfThoughtDemo() {
return (
<div className="mx-auto w-full max-w-lg p-4">
<AiChainOfThought>
<AiChainOfThoughtHeader stepCount={3} completedCount={2} />
<AiChainOfThoughtContent>
<AiChainOfThoughtStep
status="complete"
title="Understanding the question"
description="Parsed user intent and extracted key entities"
/>
<AiChainOfThoughtStep
status="complete"
title="Searching for information"
>
<AiChainOfThoughtSearchResults
results={[
{
title: "React Docs",
url: "https://react.dev",
snippet: "The library for web and native user interfaces.",
},
{
title: "Next.js Documentation",
url: "https://nextjs.org/docs",
snippet: "The React framework for the web.",
},
]}
/>
</AiChainOfThoughtStep>
<AiChainOfThoughtStep status="active" title="Formulating response" />
</AiChainOfThoughtContent>
</AiChainOfThought>
</div>
);
}