Loading component…
Loading component…
How an agent spent its time on one answer, in one small card – a bar with a segment per step, the time per kind, the models that took part and the sources it searched
To reuse this local React demo, copy all files from the Code tab into the same folder, then import ReasoningSummary from ./reasoning-summary.
import { ReasoningSummary, type ReasonStep, type ReasonModel } from "@/components/ui/reasoning-summary";
const steps: ReasonStep[] = [
{ id: "s1", kind: "search", label: "Searched the docs for rate limits", model: "opus", ms: 1800 },
{ id: "s2", kind: "analyze", label: "Compared the limits across three plans", model: "grok", ms: 2200 },
{ id: "s3", kind: "code", label: "Wrote a retry with backoff", model: "gpt", ms: 1600 },
{ id: "s4", kind: "test", label: "Ran it against the sandbox", model: "gpt", ms: 2600 },
];
const models: ReasonModel[] = [
{ id: "opus", name: "Claude Opus 5.5", logo: <ClaudeLogo />, effort: "medium", role: "Researching", provider: "Anthropic" },
{ id: "grok", name: "Grok 5", logo: <GrokLogo />, effort: "high", role: "Analyzing", provider: "xAI" },
{ id: "gpt", name: "GPT-5.5", logo: <OpenAILogo />, effort: "max", role: "Solving", provider: "OpenAI" },
];
export function Answer() {
return <ReasoningSummary steps={steps} models={models} sources={sources} sourceCount={24} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| steps | ReasonStep[] | Every step in order – one bar segment each, as wide as its share of the time | |
| ReasonStep.kind / label | string / string | What kind of step it is – its color and icon – and what it did, shown in Steps | |
| ReasonStep.ms / running | number / boolean | How long it took; leave ms out on a running step and it counts on its own | |
| ReasonStep.model | string | The id of the model that did it – ties the step to its model for highlighting and details | |
| models | ReasonModel[] | One row each: logo, name, an effort meter, role and time; a click opens its details below | |
| ReasonModel.effort | "low" \| "medium" \| "high" \| "max" | How hard it thought – four small bars, lit in the color of the kind it spent most time on | |
| ReasonModel.provider / tokens / cost / note | string / { input?, output? } / number / string | Its details: who makes it, what it read and wrote, what it cost in dollars, and why it was picked | |
| sources / sourceCount | ReasonSource[] / number | The stacked logos and the Sources list (name, detail, href); sourceCount when there were more than you pass | |
| running | boolean | Still reasoning – the header says "Reasoning", the mark twinkles, the bar leaves room to grow | |
| estimate | number | How long it will likely take (ms) – the grey track at the end of the bar shows what's probably left | |
| kinds | Record<string, { label, color, icon? }> | Names, colors and icons for kinds of your own, or to change the built-in ones | |
| agent | { id, color? } | The agent behind it – its id picks its pixel mark, color tints it (blue by default) | |
| defaultOpen | boolean | Steps open from the start | |
| className | string | Extra class on the root – set the color variables on it |
The classic style has a rounder card, pill-shaped bars and round icon tiles – the same behavior as the clean one
Fills its container's width; the kinds stay two columns, names end in … before times do
Long model names, roles, step labels and source details end in … with the full text on hover – the role gives way first, the time always stays
Below 340px of width the model's role steps aside so names keep their room; touch screens get bigger rows and buttons
Numbers read well at any size: 12,345 sources, 1.9M tokens, 2h 00m
Broken data holds: a time that isn't a number counts as 0, an unknown kind gets a grey square and its own name, a model or source without a logo shows its first letter, a step without a label shows its kind
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"