Components/Reasoning Disclosure

Reasoning Disclosure

A collapsible region for a model's reasoning trace.

VerifiedSince 0.3.9

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 durationMs together with streaming: false.
  • To remember the open state across sessions, hold it yourself and re-key the component.
  • When localizing, override label, thinkingLabel, and durationFormatter together.
  • The body is plain text only; compose with TxStreamMarkdown for Markdown.

API Reference

Props

NameTypeDefaultDescription
textstring''The reasoning body, rendered as plain text with line breaks kept.
streamingbooleanfalseOutput is still arriving; switches the header label and icon, and the body follows its tail.
durationMsnumber—Thinking time in milliseconds.
defaultOpenbooleanfalseInitial open state, read once on mount.
labelstring'Reasoning'Header label once settled.
thinkingLabelstring'Thinking…'Header label while streaming.
durationFormatter(ms: number) => string—Formats the duration; defaults to Thought for X.Xs.

Events

NamePayloadDescription
toggle(open: boolean)Fires on a header click with the resulting open state.

Overview

  • While streaming, each change to text scrolls the body to the bottom; otherwise the scroll position is left alone.
  • The header is a native <button> with aria-expanded and an aria-controls pointing at the body; the icons are aria-hidden.
  • Collapsing hides the body but keeps it mounted.