Thinking Indicator
FreeNewThe “model is thinking” row with rotating status and a reasoning disclosure.
Installation
pnpm dlx shadcn@latest add @viewport/thinking-indicator
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above.
import { ThinkingIndicator } from "@/components/viewport/thinking-indicator";
export default function ThinkingIndicatorDemo() {
return (
<div className="flex w-full max-w-sm flex-col gap-6">
<ThinkingIndicator steps={["Reading the codebase", "Planning the change", "Writing components"]} />
<ThinkingIndicator doneAfterSeconds={12}>
The user wants a pricing section. I should reuse the existing card styles, add a monthly and yearly toggle, and keep the
recommended plan visually dominant.
</ThinkingIndicator>
</div>
);
}Props
| Prop | Type | Default |
|---|---|---|
| steps | string[]Status lines to rotate through, e.g. ["Reading files", "Planning"]. | ["Thinking"] |
| interval | numberMilliseconds per step. | 1800 |
| doneAfterSeconds | numberWhen set, shows "Thought for Ns" and stops animating. | — |
| children | React.ReactNodeReasoning details revealed when the row is expanded. | — |
| className | string | — |
Accessibility
- Announces status through a polite live region, not every step.
- The disclosure is a button with aria-expanded.
- Respects prefers-reduced-motion.