# Chat Loader

A bouncing-dots indicator shown while the assistant is composing a reply.

- Category: AI & Agents
- Page: https://wunderui.com/components/chat-loader
- Tier: Core and Pro

## Install

Chat Loader ships with WunderUI Core and Pro in the @wunderui/react package.

## Import

```tsx
import { ChatLoader } from "@wunderui/react"
```

## Minimal usage

Then use it:

```tsx
import { ChatLoader } from "@wunderui/react"

export function Pending({ waiting }: { waiting: boolean }) {
  return waiting ? <ChatLoader /> : null
}
```

Expected result: You see three small grey dots that bounce in a wave. A screen reader announces Assistant is typing when they appear.

## When to use

### Use Chat Loader for

- The moment between sending a message and the first word of the reply
- A pending assistant turn in a chat that streams
- A short wait with no known length where the assistant is the one working

### Use something else

- [Spinner](https://wunderui.com/components/spinner) for a wait that is not the assistant's answer, such as a save or a refresh
- [Chat Tool](https://wunderui.com/components/chat-tool) for a tool call the agent runs while it works, with its status and result
- [Skeleton](https://wunderui.com/components/skeleton) for content with a known layout that loads, such as a list of past chats

## Behavior

What the loader does with its status, its motion and its place in the log.

- **Live region:** The loader is a polite live region with the hidden text Assistant is typing. It is read when it is added to the page, and removing it announces nothing.
- **In a log:** In a conversation log the loader is announced once when it appears. Keep the log marked busy while the reply streams, and clear it when the reply is complete.
- **Order:** The loader belongs to the pending state. When the first word arrives, swap it for the text, since a loader and a growing reply together would announce twice.
- **Length:** The loader has no timeout. For a long wait add a note next to it, and when the request ends, replace it with the failure and a retry.
- **Dots:** Each dot is 6 px and bounces once a second. The three dots start a beat apart, so they bounce in a wave.
- **Motion:** The bounce is the only motion, and it loops until you remove the loader.
- **Reduced motion:** With reduced motion the bounce is off, so the three dots stand still. They stay on screen and the status is announced as before.

## Anatomy

- `ChatLoader`: A flex row with the status role, 4 px between the dots and 4 px by 8 px of padding. It takes only a class name.
- `Dots`: Three round 6 px dots in the tertiary text colour. They bounce one after the other, each delayed a little more than the last.
- `Hidden text`: The text Assistant is typing (or your `label`), visible only to assistive technology. It is what the status announces.

## Best practices

### When to use

- Use ChatLoader at the end of a conversation while the assistant has not started its answer. For a running tool call use Chat Tool, and for a whole run use Agent Status.

### Do

- Show it after the person sends and remove it with the first streamed text, so the loader and the growing reply never appear together.
- Mount it where the answer will appear, in the assistant's bubble or beside a label. Remove its padding when the container already has some.
- Leave the built-in text alone. It tells screen readers that the assistant is typing, which moving dots cannot do, and under reduced motion the dots stand still.
- If a visible label sits beside the loader, hide it from assistive technology, so the wait is not announced twice.

### Don't

- Don't leave it on after a failure or an abort. It has no timeout or error state, so replace it with the failure message and a retry.
- Don't use it for a wait that is not the assistant's answer, such as saving a form. Use a Spinner there.

## API reference

### ChatLoader

| Prop | Type | Default | Description |
|---|---|---|---|
| bubble | boolean | false | Puts the dots in a neutral chat bubble, as the typing indicator of the other side of a conversation. |
| className | string |  | Extra classes for the row, for example `p-0` when it sits inside a bubble that has its own padding, or `justify-center` to centre it. |
| label | ReactNode | "Assistant is typing" | What a screen reader hears. Pass `Nora is typing` when a visible line already says it, and hide the loader from it there. |

## Examples

### Placement: on its own, in a bubble, or beside a label

### Own label and a bubble

## In context

### Waiting stages: the loader, a note when it takes long, a failure

The loader has no timeout and no error state. Add a note when the wait is long, and swap in the failure with a retry when the request ends.

### Pending turn: the loader gives way to the first streamed word

Press Send question. The loader announces Assistant is typing once and is gone before the first word shows, and the line under the button reads the state.

## For AI agents

`get_component("chat-loader")`

Hand your agent this page as Markdown or the WunderUI MCP server, not a screenshot.
