# ThinkingIndicator

> Live agent status line with a shimmering activity label and an elapsed timer, as a bare inline row or a bordered status pill.

- Package: `fancy-ui-react` (React 18/19 + Tailwind CSS v4)
- Category: AI Agents
- Tags: ai, agents, reasoning, status, indicator
- Types: `ThinkingIndicatorProps`
- Docs: https://fancy-ui.rama.app/docs/components/thinking-indicator
- Source: https://github.com/RamaHerbin/fancy-ui/tree/main/react/src/components/thinking-indicator

## Import

```tsx
import { ThinkingIndicator } from 'fancy-ui-react';
```

Setup (once per project): `npm install fancy-ui-react`, then put these lines in your main CSS file (the stylesheet import goes right after `@import "tailwindcss";`):

```css
@import "tailwindcss";
@import "fancy-ui-react/tailwind.css";
```

and import the component styles once in the app entry: `import "fancy-ui-react/styles.css";`. Full guide: https://fancy-ui.rama.app/llms.txt

The names below are the ones to write in React; when one differs from the Svelte name, the Svelte name follows in parentheses. `class` becomes `className`, a callback takes the name the React port declares (`onclick` becomes `onClick`), snippets become `ReactNode` props (render functions when they take arguments) and the default snippet is `children`. Divergences: https://github.com/RamaHerbin/fancy-ui/tree/main/react#divergences-from-the-svelte-api

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `status` (required) | `string` | — | What the agent is doing right now, e.g. "Reading files" |
| `running` | `boolean` | `true` | Whether the activity is in flight: drives the shimmer and the live timer |
| `variant` | `"inline" \| "pill"` | `"inline"` | Bare text row, or a bordered chip with a leading pulse dot |
| `since` | `number` | — | Epoch ms the activity started; the internal stopwatch ticks from it |
| `elapsedMs` | `number` | — | Externally-driven elapsed time in ms; overrides the internal stopwatch |
| `showElapsed` | `boolean` | `true` | Show the elapsed duration alongside the status |

## Node props

| Prop | Description |
| --- | --- |
| `done` | Rendered instead of the status label once running is false |

## Example

```tsx
import { useState } from "react";
import { ThinkingIndicator } from "fancy-ui-react";

export function ThinkingIndicatorExample() {
	const [startedAt] = useState(() => Date.now());

	return (
		<div className="flex w-full flex-col items-start gap-6">
			<ThinkingIndicator status="Reading files" since={startedAt} />

			<ThinkingIndicator variant="pill" status="Searching the web" since={startedAt - 8000} />

			{/* Finished: the shimmer stops and `done` takes over the label. */}
			<ThinkingIndicator
				status="Reading files"
				running={false}
				showElapsed={false}
				done="Thought for 12s"
			/>
		</div>
	);
}
```
