# Agent Loading

> Shimmer, cycling phrases, progress, and pixel-grid waits.

Registry name: `agent-loading`. HTML docs: https://ui.anuragroy.dev/component/agent-loading.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/agent-loading.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/agent-loading.json`.

Registry JSON: https://ui.anuragroy.dev/r/agent-loading.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/agent-loading.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

```tsx
import { AgentLoading } from "@/components/ui/agent-loading"
```

## Usage

```tsx
import { AgentLoading } from "@/components/ui/agent-loading"

export function Example() {
  return (
    <>
      <AgentLoading variant="shimmer">Generating response…</AgentLoading>
      <AgentLoading
        variant="phrases"
        phrases={["Reading…", "Comparing…", "Drafting…"]}
      />
      <AgentLoading variant="progress" value={62} elapsed="4.2s">
        Indexing files
      </AgentLoading>
    </>
  )
}
```

## API

### AgentLoading

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | "shimmer" \| "phrases" \| "progress" \| "grid" | "shimmer" |  |
| `phrases` | string[] | — |  |
| `value` | number | — | Used by the `progress` variant. |
| `elapsed` | string | — |  |

## Notes

- The shimmer variant adds a `shimmer` CSS utility via the registry item.
- Also exports `AgentLoadingText`, `AgentLoadingElapsed`, and `AgentLoadingGrid` for custom layouts.

## See also

- [HTML page](https://ui.anuragroy.dev/component/agent-loading): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/agent-loading.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
