Trust & transparency
Thinking
Use when the agent works for more than a couple of seconds before answering and the wait needs to look like progress.
Expandable reasoning trace while the agent works.
Part of Trust & transparency. The stage where the answer has arrived and the user decides whether to believe it. These patterns show how the agent got there, what it read, and how sure it is. They matter most once people start acting on what the agent says.
Do
- Write each step as something the agent did, with the detail that proves it: "Reading 42 unread threads".
- Collapse the trace once the answer is ready, and leave it one tap away.
- Show elapsed time while working and the total once done.
Don't
- Don't show raw model reasoning. Summarise it into steps a customer could read.
- Don't leave the trace open above the answer. It pushes the thing they asked for down the page.
- Don't use it for waits under a second. A plain indicator is enough.
States
- Thinking: Animated dots, the label and a running timer. Steps appear one by one, the current one marked with the accent.
- Done: The header changes to a chevron and "Thought for 4.4 seconds". The full trace stays open for a moment.
- Collapsed: After a short pause the trace folds away and only the header remains.
- Reopened: Pressing the header expands the finished trace again. The header only responds once thinking is done.
Usage
import { ThinkingTracePattern } from "./halaska-kit";
<ThinkingTracePattern
steps={[
{ label: "Reading ticket #4821", detail: "Intercom · Cobalt Dental" },
{ label: "Checking the runbook", detail: "Notion · reminder delivery" },
]}
onDone={showAnswer}
/>
ThinkingTracePattern props
steps{ label: string, detail?: string }[](default THINKING_TRACE_STEPS): Reasoning steps, revealed one per `stepMs` (default: THINKING_TRACE_STEPS)stepMsnumber(default 1100): Milliseconds per step; total think time = steps.length × stepMs (default: 1100)thinkingLabelstring(default "Thinking"): Label shown while thinking (default: "Thinking")doneLabel(seconds: number) => string(default (seconds) => `Thought for ${seconds.toFixed(1)} seconds`): Header label once done (default: `Thought for ${seconds.toFixed(1)} seconds`)collapseDelayMsnumber(default 1000): Pause after done before the trace collapses (default: 1000)autoCollapseboolean(default true): Collapse the trace automatically after done (default: true)autoplayboolean(default true): Run the timed trace on mount; false renders the finished, collapsed state with no timers (default: true)defaultOpenboolean(default autoplay): Initial expanded state of the trace (default: autoplay)onDone(seconds: number) => void: Fires when thinking completes (autoplay only)onToggle(open: boolean) => void: Fires when the trace expands/collapses, by user click or auto-collapse
Built from
Label, Thinking Indicator, Typography
Related patterns
Halaska UI · Components · Patterns · Screens · Install