Thinking Shimmer

A model's reasoning as a moving window that folds into a receipt.

Category
Creative
Access
Free with an account
Source
146 lines · one file
States
5 drawn

The decision inside it

A window, not a log

Only the last three thoughts are on screen, so the block never grows while it works and the answer below does not jump with every step. Finished, it stays in the thread as a record instead of vanishing when the answer starts.

When to use it

Use Thinking Shimmer while a model reasons: append each thought as it streams, then set done to fold it into a receipt. For the answer itself use Token Stream.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Liro's Thinking Shimmer for this.
Install it: npx shadcn@latest add @liro/thinking-shimmer
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/thinking-shimmer.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Free components install through the @liro registry with your CLI token: see the Namespaced tab.

Usage

components/reasoning.tsx
import { ThinkingShimmer } from "@/components/ui/thinking-shimmer";

export function Reasoning({ thoughts, done }: { thoughts: string[]; done: boolean }) {
  return <ThinkingShimmer thoughts={thoughts} done={done} />;
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

TypeNotes
thoughtsstring[] YesThe reasoning so far, oldest first. Append as it arrives.
doneboolean NoFinished: fold into a one-line receipt.
labelstring NoThe word that shimmers. Default "Thinking".
secondsnumber NoSeconds taken. Counted from mount when left out.
visiblenumber NoHow many thoughts the live window shows. Default 3.

Dependencies

npm packages

clsxframer-motionlucide-reacttailwind-merge

Liro foundations, installed alongside it

liro-theme

States

All of them are drawn by the component. None is left for you to design.

  • Thinking
  • New thought
  • Done
  • Expanded
  • Reduced motion

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances