Skip to content
Thrum

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-panel

This 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
type ReasoningStep = {
  id: string;
  title: string;
  detail?: string;
  timestamp?: string;
  status?: "done" | "active" | "pending";
};
Sample
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

PropTypeDefaultDescription
stepsreadonly ReasoningStep[]RequiredOrdered list of thought steps rendered along the vertical rail when expanded.
streamingbooleanDefault falseShows a live pulsing amber lamp and active step indicator while reasoning is in progress.
durationMsnumber | nullDefault nullElapsed thinking duration in milliseconds, formatted in the header when showDuration is true.
showDurationbooleanDefault truePrints the elapsed duration in the header trigger.
tokensnumber | nullDefault nullOptional token count printed in the panel footer.
labelstring–Custom header text replacing the default Thinking… or Thought for 2.4s string.
openboolean–Controlled open state. Pair with onOpenChange.
defaultOpenbooleanDefault falseWhether the trace starts expanded when uncontrolled.
onOpenChange(open: boolean) => void–Called when the reader toggles the disclosure.
emptyLabelstringDefault "No reasoning steps recorded."Fallback copy shown when opened with an empty steps array.
pausedbooleanDefault falseFreezes the streaming status pulse animation where it is.
soundbooleanDefault truePlays open/close on toggle and success when streaming finishes, if the visitor has sound on.
classNamestring–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.
KeysAction
TabMove focus to the disclosure trigger button.
Enter / SpaceExpand or collapse the reasoning trace.

Source

SourcePro

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. 1.0.0 · 2026-12-04First release.

Loading index…

Keyboard shortcuts

/Ctrl KSearch components, docs and actions
?Show this list
AAppearance studio
SSound on or off
MFull or reduced motion
TTheme: auto, light, dark
GSurface: solid or frosted
BBackdrop photograph (under glass)
CCorner radius: square to round
RReplay the demo, on a component page
DDraw new data, on a component page
←→HomeEndMove the cursor in a focused chart
EscClose a dialog, or leave a chart cursor