Feedback
TwSpinner
TwSpinner is a Blazor loading spinner component. Set Size, Color, Label and ShowLabel, or use it inside a button.
Last updated
Basic Usage
An animated loading indicator rendered as an
<output> element, so status changes are announced to assistive technology. The Label ("Loading..." by default) is always in the DOM for assistive technology, even when not shown visually.Razor
<TwSpinner AriaLabel="Loading" />Sizes
Use
Size to control the spinner's dimensions.Razor
<div class="flex items-center gap-6">
<TwSpinner Size="SpinnerSize.Small" AriaLabel="Loading, small" />
<TwSpinner Size="SpinnerSize.Medium" AriaLabel="Loading, medium" />
<TwSpinner Size="SpinnerSize.Large" AriaLabel="Loading, large" />
</div>Colors
Use
Color to match the spinner to its surrounding context.Visible Label
By default the label text is only announced to assistive technology. Set
ShowLabel to display it next to the spinner too.Razor
<div class="flex flex-col gap-4">
<TwSpinner Label="Loading..." ShowLabel Color="Color.Primary" />
<TwSpinner Label="Uploading files..." ShowLabel Size="SpinnerSize.Small" Color="Color.Success" />
</div>Theme Configuration
Styling is controlled by
TwBlazorTheme.Components (a TwSpinnerTheme), configured via the
AddTwBlazor() options callback described on the Get Started page.
Every property is a set of Tailwind classes, so changes are picked up by your own Tailwind build.
Global Theme Configuration
These reuse shared design tokens configured once on TwBlazorTheme, rather than being unique to this component.
| Property | Type | Controls |
|---|---|---|
Colors |
TwBlazorPalette |
Full reference: TwSpinnerTheme on the API docs.