# Loader (/docs/agent-ui/components/loader)

Use a loader while a conversation, a file or a tool result loads. Its label says what's loading.

<Example caption="The dots flow while the conversation loads. With reduced motion on, they hold still.">
<g />

```tsx
import { Loader } from "@/components/ui/loader";

export default function LoaderExample() {
  return <Loader label="Loading conversation" />;
}
```
</Example>

## Installation [#installation]

```bash tab="React"
npx shadcn@latest add @kind-ui/loader
```

```bash tab="Web Components"
npx shadcn@latest add @kind-ui/loader-web
```

## Usage [#usage]

### Label [#label]

Pass `label` to say what's loading. It shows beside the dots and names the loader, "Loading" by default. The loader is a polite status, so screen readers read a new label when it changes. The dots are hidden from them.

### Motion [#motion]

The dots flow one after another. Under `prefers-reduced-motion`, or with `motion="reduced"` or `"none"`, they hold still. The loader takes no focus and has no keys.

## API Reference [#api-reference]

### IndicatorOptions

| Prop      | Type                            | Description                                                                                                                                                       |
| --------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `label?`  | `string \| undefined`           | Names the status, and screen readers read it again when it changes. Loader and Thinking Indicator also show it; it defaults to "Loading", "Thinking" or "Typing". |
| `motion?` | `"auto" \| "none" \| "reduced"` | Whether the dots move: `"auto"` follows `prefers-reduced-motion`, and `"reduced"` or `"none"` hold them still. Default: `"auto"`                                  |

### Agent [#agent]

An agent connected with `createAgent` sees the loader as a status named by its label. It has no actions of its own.

<Caption>
Runs in React and Web Components. On `<kind-loader>`, `label` and `motion` are attributes of the same name, and the element fills in its label and dots when it has no children.
</Caption>