Skip to main content

Reasoning

Preview

A model's reasoning in a chat answer, folded under a label that reads "Thinking…" while it streams. It starts closed, so the answer stays what the reader sees first.

Desktop viewport
Tablet viewport
Mobile viewport

When to use

  • Show the reasoning a model wrote before its answer, inside a chat message.
  • Use Tool Call for a tool the model called.
  • Prefer Accordion for titled sections that are not part of a chat answer.

While it streams

Set streaming on Reasoning.Root while the model writes its reasoning. Reasoning.Trigger then reads "Thinking…" and pulses, with no motion when the reader prefers reduced motion. After that it shows its children, such as "Thought for 4 seconds", or "Reasoning" when it has none.

Desktop viewport
Tablet viewport
Mobile viewport

Composition

Reasoning.Root├── Reasoning.Trigger└── Reasoning.Content

Polymorphism

No part takes asChild. Each one renders more than one element, or an element beside its children.

Translation

Reasoning.Trigger renders a caret beside its label. The label sits in a display: contents wrapper, data-slot="reasoning-trigger-label", so a page that a browser translates survives the change from "Thinking…".

API Reference

Reasoning.Root

The reasoning disclosure. It starts closed.

All props from div, plus:

PropTypeDefaultDescription
streaming?booleanfalseTrue while the model writes its reasoning. The trigger reads "Thinking…".
Data AttributeValueDescription
data-streamingpresent while streamingPresence-only. Style with data-streaming:.

Reasoning.Trigger

The disclosure label reads "Thinking…" and pulses while streaming, then shows its children or "Reasoning" when empty.

All props from button except type.

Data AttributeValueDescription
data-slot="reasoning-trigger-label"on the wrapperThe display: contents wrapper around the label.

Reasoning.Content

The model's summary, as plain text or Markdown in muted type. Find-in-page reaches it while it is closed.

All props from div.