Thinking loader preview

Thinking loader

A small working pill for AI replies – an eight-ray spinner and a shimmering label that rolls through phases and settles on a check

  • Group
    Chat
  • Origin
    Copied · affectUI · source
  • License
    MIT
  • Added
    Oct 18
npx shadcn@latest add @deank/thinking-loader

The registry stays private. Install from the repo with a GitHub token — see the README.

Usage

import { ThinkingLoader } from "@/registry/components/thinking-loader/thinking-loader";

<ThinkingLoader />

Props

NameTypeDefaultDescription
phasesstring[]["Thinking", "Searching the web", "Reading sources", "Writing response"]Labels to walk through, one after another
intervalnumber2200Time per phase in ms when the phase isn't controlled
phasenumberControlled index into phases – the timer stops and the loader shows this phase
loopbooleanfalseStart over after the last phase instead of holding it
donebooleanfalseTurns the spinner into a check and the label into doneLabel; setting it back to false starts over
doneLabelstring | ((seconds: number) => string)(s) => Thought for ${s}sLabel once done – a function gets the seconds since the loader started
size"sm" | "md""md"28 or 34px tall
variant"pill" | "plain""pill"A bordered capsule, or just the spinner and the label
classNamestringExtra class on the root

When to use

- The wait between sending a prompt and the first streamed token – one line that says what the model is doing - Agent and pipeline steps with real labels: searching, reading, running a tool, writing - Inline in a chat bubble or next to a button where a full panel would be too much

When not to use

Generic page loading (bars-spinner, shimmer-loader).

Related

Shimmer loader · Tool call card · Liquid orb