This example demonstrates how to replace the default bouncing dots loading indicator with a custom animated SVG.
The loadingIndicator.render config option lets you provide a custom function that returns an HTMLElement. The function receives a context with the location ('standalone' or 'inline') so you can use different indicators in different places.
Add data-preserve-animation="true" to your custom element to prevent the DOM morpher from interrupting CSS animations during updates.
standalone: Shown in its own bubble while waiting for the stream to start.
inline: Shown inside the assistant message bubble when content is empty.
Set showBubble: false to hide the background, border, and shadow from the standalone indicator wrapper. This lets custom animated icons render without the default bubble styling.
Show a custom indicator when the assistant is waiting for the next user message. Use loadingIndicator.renderIdle to customize what appears after a response completes.
Return null to hide the indicator entirely. You can also use a plugin's renderLoadingIndicator or renderIdleIndicator hooks for the same functionality.