Chat Loader
ProThree dots that show the assistant has not started its answer yet.
Playground
Installation
Chat Loader comes with WunderUI Core and Pro, in the package from your plan. See the plans.
Then import what you need:
import { ChatLoader } from "@wunderui/react"Then use it:
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
Placement
Put the loader where the answer will appear: in the assistant's bubble, or beside a visible label. Remove its padding when it sits inside something that already has some.
Newer props
label is what a screen reader hears; bubble puts the dots in a neutral chat bubble for the other side of a conversation. Hide the loader from assistive tech when a visible line already says who is typing.
Own label and a bubble
Behavior and motion
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
The figure marks the loader and one of its dots. The hidden text has no box on screen, so it has no number.
- 1
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.
- 2
Three round 6 px dots in the tertiary text colour. They bounce one after the other, each delayed a little more than the last.
The text Assistant is typing (or your ), visible only to assistive technology. It is what the status announces.
Best practices
- 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.
- Do
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.
- Do
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.
- Do
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
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 is a plain component with one prop and wraps no primitive.
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.
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | Extra classes for the row, for example when it sits inside a bubble that has its own padding, or to centre it. |
| bubble | boolean | false | Puts the dots in a neutral chat bubble, as the typing indicator of the other side of a conversation. |
| label | ReactNode | "Assistant is typing" | What a screen reader hears. Pass when a visible line already says it, and hide the loader from it there. |
Notes for AI
Give your coding assistant the Markdown reference instead of screenshots.
get_component("chat-loader")The full library index for assistants is at /llms.txt.