ChatShimmer
Text with a sweeping highlight, for loading states. With reduced motion it is static, muted text.
On this page
Examples
Shimmering text
Thinking...
Searching the documentation for an answer
Razor
@* The sweep is plain CSS. With reduced motion the text is static and muted. *@
<div class="flex flex-col items-start gap-2 text-sm" data-testid="chat-shimmer-example">
<KlyChatShimmer Text="Thinking..." data-testid="chat-shimmer" />
<KlyChatShimmer Text="Searching the documentation for an answer" Duration="3" Spread="3" />
</div>API
KlyChatShimmer
Text with a sweeping highlight, to show that something is in progress. It is plain and muted when the user prefers reduced motion.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
Class |
string |
Classes added to the root element, merged last so they win over the theme. | |
Duration |
Double |
2 |
Seconds one sweep takes. |
Spread |
Double |
2 |
Width of the highlight, relative to the text: 2 by default, bigger is a wider band. |
Text (required) |
string |
"" |
The text to shimmer. |
Ui |
ChatShimmerUi |
Per-instance class overrides of the slots of the chat shimmer, see ChatShimmerUi . They are merged after the theme and the Class parameter wins on the root slot. |
Ui slots
Ui takes a ChatShimmerUi with one class string per slot, merged after the theme.
| Slot | Styles |
|---|---|
Base |
Classes merged into the base slot of KlyChatShimmer , after the theme and the app configuration. |