Reasoning Disclosure
A collapsible region for a model's reasoning trace.
Usage
Basic
The duration shows only when streaming is false and durationMs is set.
Loading demo...
Best Practices
- Leave it collapsed by default; an open trace pushes the answer below the fold.
- When streaming ends, set
durationMstogether withstreaming: false. - To remember the open state across sessions, hold it yourself and re-key the component.
- When localizing, override
label,thinkingLabel, anddurationFormattertogether. - The body is plain text only; compose with
TxStreamMarkdownfor Markdown.
API Reference
Props
| Name | Type | Default | Description |
|---|---|---|---|
text | string | '' | The reasoning body, rendered as plain text with line breaks kept. |
streaming | boolean | false | Output is still arriving; switches the header label and icon, and the body follows its tail. |
durationMs | number | — | Thinking time in milliseconds. |
defaultOpen | boolean | false | Initial open state, read once on mount. |
label | string | 'Reasoning' | Header label once settled. |
thinkingLabel | string | 'Thinking…' | Header label while streaming. |
durationFormatter | (ms: number) => string | — | Formats the duration; defaults to Thought for X.Xs. |
Events
| Name | Payload | Description |
|---|---|---|
toggle | (open: boolean) | Fires on a header click with the resulting open state. |
Overview
- While streaming, each change to
textscrolls the body to the bottom; otherwise the scroll position is left alone. - The header is a native
<button>witharia-expandedand anaria-controlspointing at the body; the icons arearia-hidden. - Collapsing hides the body but keeps it mounted.