Reasoning

Shows what the model thought before answering.

States

  • thinking

  • Checking the refund policy

    Damaged items are refunded in full within 30 days. The order shipped 6 days ago.

    Confirming the amount

    The order total is $48.00 with no shipping charge.

    thinking with heading

  • folded

  • Checking the refund policy

    Damaged items are refunded in full within 30 days. The order shipped 6 days ago.

    Confirming the amount

    The order total is $48.00 with no shipping charge.

    open

  • stopped early

  • hover

  • focus-visible

Usage

When to use it
Use
A model streams its reasoning before the answer and the person may want to read it.
Use
A turn should keep the answer on screen and the thinking one line away.
Not for
The steps are tool calls with results. Use Tool call.
Not for
A plain section anyone can open, not tied to a stream. Use Collapsible.

Rules

6 rules
Must
Drive it with streaming, not open: it opens while the reasoning streams and folds when it ends. Because controlled open turns off the automatic fold and the person's pin, so the thinking stays over the answer or never shows.
Must
Pass duration in seconds once the reasoning ends. Because the folded line reads "Thought for 12s"; milliseconds read as hours and no duration reads "a moment".
Should
Pass summary parts as an array of strings; the label follows the first heading of the newest part. Because a joined string labels the trigger with the first heading of the whole text, which goes stale as new parts arrive.
Never
Put the answer inside Reasoning; it sits above Response in the turn. Because the fold hides its body when the reasoning ends, so an answer inside it disappears.
Never
Restyle the trigger as a button with a fill or glass; it is a flat row like a folded tool group. Because it shows text, it does not act, and the turn's rows share one column and one look.
Should
Keep Reasoning in the turn when a run stops before any reasoning arrives. Because its line then reads "Stopped before thinking", which says why there is no answer.

State order

5 states, highest first
1
focus-visible
2
hover
3
thinking
4
open
5
folded

Accessibility

3 checks
The trigger is a button with aria-expanded; the arc beside it is aria-hidden and the label says Thinking.
The body is marked aria-busy while it streams and takes a tab stop only when it scrolls.
Focus is the inset ink ring on the row.

Keyboard

1 key
Enter, Space
Opens or folds the reasoning; opening after the fold pins it.

Edge cases

5 edge cases
Person closes it while streaming
It stays closed until the next stream.
Person reopens it after the fold
It opens from the top and stays open.
Long reasoning
The pane is 160px tall at most and follows new text until the person scrolls up.
59.6 seconds
Reads "1m 00s", never "60s".
Reduced motion
The arc stands still and the caret jumps.

API

6 props
children
string | string[] | ReactNode
streaming
boolean default false
duration
number
heading
string default from the text
defaultOpen, open, onOpenChange
boolean, boolean, (open) => void default false
labels
{thinking, stoppedEarly, thoughtFor, moment} default English

Tokens

11 tokens
--hover
rgb(5 5 5 / 0.06)
--pressed
rgb(5 5 5 / 0.10)
--radius-tag
6px
--control
32px
--type-body-sm
400 13px/1.5 var(--font-sans)
--text-1
rgb(5 5 5 / 0.80)
--text-2
rgb(5 5 5 / 0.60)
--text-3
rgb(5 5 5 / 0.45)
--focus
rgb(5 5 5 / 0.80)
--dur-state
160ms
--dur-spin
800ms

Install

For your coding agent

GitHub

Please star me pookie

141

A new design system every week

Leave your email before you copy the prompt.