Skip to main content
This widget is and is subject to change in minor versions.
The chat widget shows a loader while a chat turn is in progress. The default loader includes a spinner, optional text, and skeleton lines. Use templates.loaderText to change the text or templates.loader to replace the loader. To change when and where the loader renders, see Control when and where the chat loader shows.

Change the loader text

The default loader doesn’t show any text. Add some with templates.loaderText:
JavaScript

Change the text by turn phase

Pass a function to loaderText to change the text based on the turn context. Use phase to identify the current phase:
JavaScript
The function receives the same turn context as shouldShowLoader, without defaultValue.

Replace the loader

Use the loader template to render your own loading state. It receives:
  • translations. The resolved loader translations.
  • context. The same context as loaderText receives.
  • inline. Whether the loader renders inside an assistant message. It’s true when loaderPosition is message-inline and an assistant message is available.
JavaScript
Use inline if your custom loader needs different markup or spacing when it appears inside a message.

Reuse the default loader

Instead of writing the markup yourself, render the built-in loader with the chatMessageLoader template helper and override what you need. It keeps the default spinner, skeleton lines, and animations. Pass the received properties to chatMessageLoader, then override translations, className, or any element attribute:
JavaScript

Rotate loading messages while the agent is working

Prefer phase, since it tracks the current phase of the turn. For long waits within one phase, cycle through a short set of messages with CSS. Render them all in the template, then fade between them:
JavaScript
CSS
Keep each message short, and don’t describe work the agent isn’t doing.
Last modified on August 27, 2026