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@latest add ChainOfThought

Examples

Thinking and groups

Tool activity belongs inside the same chronological trace.
Read README.mdComplete
Input:
Output:
extended thinking tool use
Waiting for results…
The search provider did not respond.
Input:
Output:
Input:
Output:
Input:
The fixture service is unavailable.

Read and edit

Read README.mdComplete
README.md
+1·−1Complete
README.md · markdown
+1−1
--- a/README.md
+++ b/README.md
@@ -1 +1 @@
1RemovedExtended thinking examples
1AddedExtended thinking examples and implementation notes

Custom renderer

PeriodConversion
Current6.4%
Previous5.9%

Streaming

Thinking in progress

Controlled disclosure

Parent state controls this 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'