This widget is and is subject to change in minor versions.
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 withtemplates.loaderText:
JavaScript
Change the text by turn phase
Pass a function toloaderText to change the text based on the turn context.
Use phase to identify the current phase:
JavaScript
shouldShowLoader, without defaultValue.
Replace the loader
Use theloader template to render your own loading state.
It receives:
translations. The resolved loader translations.context. The same context asloaderTextreceives.inline. Whether the loader renders inside an assistant message. It’struewhenloaderPositionismessage-inlineand an assistant message is available.
JavaScript
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 thechatMessageLoader 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
Preferphase, 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