Reasoning panel
A collapsible thought-trace disclosure that surfaces step-by-step reasoning alongside live streaming status, elapsed duration and token totals. Use it above assistant responses or workflow outputs when readers need to inspect how a conclusion was reached without cluttering the primary answer. For structured action parameters and approval gates, use the tool call card.
Install
npx shadcn@latest add @thrum-pro/reasoning-panelThis is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.
Automatically installs icons chevron-down and circle-check from the icon set.
Data shape
type ReasoningStep = {
id: string;
title: string;
detail?: string;
timestamp?: string;
status?: "done" | "active" | "pending";
};const steps: ReasoningStep[] = [
{ id: "1", title: "Inspect billing ledger", detail: "Matched 1,412 settled invoices.", timestamp: "0.4 s" },
{ id: "2", title: "Verify net variance", detail: "Discrepancy reduced to $0.14.", timestamp: "1.9 s" },
];Props
| Prop | Type | Default | Description |
|---|---|---|---|
steps | readonly ReasoningStep[] | Required | Ordered list of thought steps rendered along the vertical rail when expanded. |
streaming | boolean | Default false | Shows a live pulsing amber lamp and active step indicator while reasoning is in progress. |
durationMs | number | null | Default null | Elapsed thinking duration in milliseconds, formatted in the header when showDuration is true. |
showDuration | boolean | Default true | Prints the elapsed duration in the header trigger. |
tokens | number | null | Default null | Optional token count printed in the panel footer. |
label | string | – | Custom header text replacing the default Thinking… or Thought for 2.4s string. |
open | boolean | – | Controlled open state. Pair with onOpenChange. |
defaultOpen | boolean | Default false | Whether the trace starts expanded when uncontrolled. |
onOpenChange | (open: boolean) => void | – | Called when the reader toggles the disclosure. |
emptyLabel | string | Default "No reasoning steps recorded." | Fallback copy shown when opened with an empty steps array. |
paused | boolean | Default false | Freezes the streaming status pulse animation where it is. |
sound | boolean | Default true | Plays open/close on toggle and success when streaming finishes, if the visitor has sound on. |
className | string | – | Merged onto the outer panel container. |
Motion and sound
Motion
- Expanding and collapsing animates height and opacity over 250 ms with the standard out curve.
- The header chevron rotates 180 degrees over 150 ms.
- While streaming, the status lamp pulses every 1.6 seconds; paused freezes it in place.
- Reduced motion: disclosure changes and chevron rotation settle immediately, and the pulse stops.
Sound
- Expanding the trace plays open; collapsing plays close.
- Transitioning from streaming to complete plays success once.
Sound is off until the visitor turns it on. Pass sound={false} to keep this component silent. How sound works
Accessibility
- The header trigger is a native button exposing aria-expanded and aria-controls linked to the collapsible region.
- Live streaming status pairs an amber pulsing lamp with the word Thinking…, and completion pairs a check glyph with Thought for 2.4s, never relying on colour alone.
- A polite status region announces when reasoning is active without interrupting the reader.
- The outer frame carries data-surface="panel", keeping 4.5:1 text contrast across Solid and Frosted glass themes.
| Keys | Action |
|---|---|
| Tab | Move focus to the disclosure trigger button. |
| Enter / Space | Expand or collapse the reasoning trace. |
Source
The source comes with Pro
TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies
Files and dependencies
- Adds
components/ui/reasoning-panel.tsx- Packages
motion- Brings along
- Status dotChart foundationsMotion tokensSound engine
- Icons
chevron-downcircle-check
Changelog
- 1.0.0 · 2026-12-04First release.