ReasoningPanel
A collapsible trace that streams reasoning steps, then settles into a summary.
Install it:
npx shadcn add @ambientui/reasoning-panelLive
Behavior
- ·STAGES ITS ARRIVAL: shimmer, a beat of nothing, then one step at a time. The block is complete in the data and would paint in a single frame — painting it instantly says the work was free, and robs the reader of the one thing a trace is for.
- ·staged={false} renders it settled, which is what a re-rendered older message must do: history is written, not re-thought.
- ·INSIDE A RESPONSE, BLOCKS WAIT FOR EACH OTHER: thinking finishes, then the next evidence block works, then the prose streams. The stage queue enforces the order in the shared hook, so a block inherits it by being staged at all — see DESIGN.md §8. On its own (this playground) a block has no queue and stages immediately.
- ·The counter is REAL — it ticks actual seconds while the trace is arriving, and the settled summary quotes what it measured rather than a prop. A trace that claims 'thought for 5s' when it took two is a decoration pretending to be a measurement.
- ·It runs on the block's WORKING state and freezes the moment the work stops: not while queued behind an earlier block (that is someone else's time) and not after the last item lands (a settled summary must quote a number that has stopped moving).
- ·Thinking holds to a floor (THINKING_FLOOR_MS) so an answer never appears to think for a blink and then know everything. The floor is a real wait, which is what keeps the counter a measurement.
- ·Each step's detail is WRITTEN, not revealed: it streams through the same StreamingText the answer itself uses.
- ·Opens itself while the run is live and collapses to one line when it finishes — reasoning is interesting WHILE it happens and reference material after.
- ·The settled summary states the cost in time ("Thought for 5s"), which is the part worth knowing at a glance.
- ·Steps are marked, not connected: they are ordered, not causally chained, and a connector would claim more than the model did.
- ·The user's own toggle wins — pass defaultOpen to opt out of the automatic behavior entirely.
When to use
- ·Any run where thinking takes long enough that silence reads as a hang.
- ·When the reasoning is genuinely reviewable — a plan, a search strategy, a chain of constraints.
When not to
- ·To pad a fast answer with theatre; a trace on a 200ms reply is a costume.
- ·For tool activity, which has its own objects (ToolCall, ToolTimeline).