ChainOfThought

Pro

A compact, inspectable record of reasoning and agent work behind a response.

Compare the official guide with practical examples, then verify the component checks.
Reviewing extended-thinking references in progress

Installation

Add this component with the NateUI CLI.

npx @nateui/cli@latest add ChainOfThought

Examples

Thinking and groups

Read and edit

Custom renderer

Streaming

Controlled disclosure

API

ChainOfThought

PropDescriptionTypeDefault
statusLifecycle state for the complete trace; the running summary uses Shimmer.'pending' | 'running' | 'complete' | 'error''complete'
summaryCaller-owned trigger summary.ReactNodestatus-based summary
toolCountExplicit tool count shown beside the summary.number—
iconRoot identity icon.ReactNodeLightbulb icon
openControlled disclosure state.boolean—
defaultOpenInitial uncontrolled disclosure state.booleanfalse
onOpenChangeCalled when the root disclosure changes.(open: boolean) => void—
collapseDelaySettled auto-collapse delay in milliseconds. false disables it.number | false1000
maxHeightOpt-in maximum height for the whole trace; without it, all rows remain visible.number | string—
childrenCompound activity rows.ReactNode—

ChainOfThought.Thinking

Thinking can also render by itself; the root is only needed when several activities share one trace lifecycle and summary.

PropDescriptionTypeDefault
titleThinking row title.ReactNode—
statusLifecycle state for the row; a running title uses Shimmer and a body-bearing row opens on entry.ChainOfThoughtStatus'complete'
iconOptional identity icon; it remains visible while the row is running.ReactNodeLightbulb icon
openControlled disclosure state; applies when body content is present.boolean—
defaultOpenInitial uncontrolled disclosure state; applies when body content is present.booleanfalse
onOpenChangeCalled when the body disclosure changes.(open: boolean) => void—
autoOpenOpens the body when the row enters running; set false to keep it folded until the user opens it.booleantrue
maxHeightMaximum height for the Thinking body. false shows all content without internal scrolling.number | string | false180
childrenSupporting reasoning content. Present content creates an independent disclosure; without it, Thinking stays a plain row.ReactNode—

ChainOfThought.Group

PropDescriptionTypeDefault
labelPhase or step label.ReactNode—
toolCountExplicit number of tools in the group.number—
open / defaultOpenGroup disclosure state.booleanfalse
childrenNested thinking and tool rows.ReactNode—

ChainOfThought.Tool

Tool is a discriminated union. The type value is explicit and selects one visual contract: search, execute, read, edit, or custom.

TypeRequired surface
searchQuery, structured results with a 180px default internal viewport, optional result count, domain, favicon, links, and error text.
executeInput code, optional language, output, and error text.
readFile link or action sibling; read rows do not create a false disclosure.
editFile link or action sibling, bounded unified diff, language metadata, and addition/deletion counts.
customCaller-owned icon, title, and optional rich children.

All tool variants accept status, title, open, defaultOpen, onOpenChange, errorText, and className where a disclosure body exists. Running titles use Shimmer while the tool's type icon remains visible.

PropDescriptionTypeDefault
autoOpenOpens the body when the tool enters running; set false to keep it folded until the user opens it.booleantrue

Search tools also accept maxHeight (number | string | false) for the results list. false shows all results without internal scrolling.

Types

type ChainOfThoughtStatus = 'pending' | 'running' | 'complete' | 'error'