Chain of Thought

Display step-by-step reasoning and collapsible thought processes in AI interfaces

Examples

Basic chain of thought

Advanced reasoning steps

Installation

npx shadcn add "https://prompt-kit.com/c/chain-of-thought.json"

Component API

ChainOfThought

PropTypeDefaultDescription
childrenReact.ReactNodeChainOfThoughtStep components
classNamestringAdditional CSS classes

ChainOfThoughtStep

PropTypeDefaultDescription
childrenReact.ReactNodeChainOfThoughtTrigger and ChainOfThoughtContent
classNamestringAdditional CSS classes
isLastbooleanfalseWhether this is the last step in the chain
...propsReact.ComponentProps<typeof Collapsible>Additional collapsible props

ChainOfThoughtTrigger

PropTypeDefaultDescription
childrenReact.ReactNodeTrigger content
leftIconReact.ReactNodeIcon displayed before the trigger text
swapIconOnHoverbooleantrueWhether to swap icon on hover
classNamestringAdditional CSS classes
...propsReact.ComponentProps<typeof CollapsibleTrigger>Additional collapsible trigger props

ChainOfThoughtContent

PropTypeDefaultDescription
childrenReact.ReactNodeContent displayed when expanded
classNamestringAdditional CSS classes
...propsReact.ComponentProps<typeof CollapsibleContent>Additional collapsible content props

ChainOfThoughtItem

PropTypeDefaultDescription
childrenReact.ReactNodeItem content
classNamestringAdditional CSS classes
...propsReact.ComponentProps<"div">Additional div props