Captain UI

Thinking

The agent's reasoning: a line that ripples while it thinks, “Thought for 12s” when it's done, and the full reasoning one click away.

npx shadcn@latest add https://captain-ui.vercel.app/r/thinking.json

checkout.spec.ts is flaky again. Can you find out why?

…

Usage

import { Thinking } from "@/components/ui/thinking"

<Thinking active={part.state === "streaming"}>{part.text}</Thinking>

Props

PropTypeDefaultWhat it does
activebooleanTrue while the model is still reasoning.
childrenstringThe reasoning so far. It can grow while active.
startedAtnumberEpoch ms when reasoning started, for the timer.
secondsnumberHow long it took, if you already know.
openWhileActivebooleanfalseShow the reasoning as it streams, then fold it away.
defaultOpenbooleanfalseStart open.

Keyboard

Enter / Space
Open or close the reasoning

Accessibility

  • A disclosure button with aria-expanded.
  • The label is read once, not letter by letter.
  • Streaming text is a polite live region while open.
  • The ripple stops under reduced motion.