Loading component…
Loading component…
AI working panel with a live timer, searched sources and thinking steps that appear one by one
To reuse this local React demo, copy all files from the Code tab into the same folder, then import ThinkingState from ./thinking-state.
import { ThinkingState } from "@/components/ui/thinking-state";
const steps = [
{ kind: "search", label: "Searched", sources: [{ label: "acme.com" }, { label: "+4 more" }] },
{ kind: "step", label: "Reading the sources" },
{ kind: "step", label: "Drafting your answer" },
];
export function AssistantMessage() {
return <ThinkingState steps={steps} onDone={(seconds) => console.log(seconds)} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| steps | ThinkingStep[] | Searches and thinking steps, revealed in order. Sources can link out (href) and show a tooltip; moreSources hide behind a “+N more” chip | |
| doneLabel | string | "Finished thinking" | Label of the final row |
| stepMs | number | 1300 | Pause between two steps, in ms |
| loop | boolean | false | Starts over a few seconds after finishing |
| onDone | (seconds: number) => void | Called once all steps are done | |
| className | string | Extra class on the root |
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"