Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Thinking Indicator

FreeNew

The “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.

thinking-indicator-demo.tsx
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

PropTypeDefault
stepsstring[]

Status lines to rotate through, e.g. ["Reading files", "Planning"].

["Thinking"]
intervalnumber

Milliseconds per step.

1800
doneAfterSecondsnumber

When set, shows "Thought for Ns" and stops animating.

—
childrenReact.ReactNode

Reasoning details revealed when the row is expanded.

—
classNamestring—

Accessibility

  • Announces status through a polite live region, not every step.
  • The disclosure is a button with aria-expanded.
  • Respects prefers-reduced-motion.