Spinner
An indicator that can be used to show a loading state.
Installation
Usage
<Spinner />Customization
You can replace the default spinner icon with any other icon by editing the Spinner component. This one uses lucide's loader-circle icon, from Blazix.Icons.Lucide.
@using Blazix.Icons
@using Blazix.Icons.Lucide
@using static Blazix.Registry.ClassNames
<Icon Data="LucideIcons.LoaderCircle" data-slot="spinner" role="status" aria-label="Loading" @attributes="AdditionalAttributes"
class="@Cn("size-4 animate-spin", Class)" />
@code {
[Parameter] public string? Class { get; set; }
[Parameter(CaptureUnmatchedValues = true)]
public IReadOnlyDictionary<string, object>? AdditionalAttributes { get; set; }
}Size
Use the size-* utility class to change the size of the spinner.
Button
Add a spinner to a button to indicate a loading state. Place the <Spinner /> before the label with data-icon="inline-start" for a start position, or after the label with data-icon="inline-end" for an end position.
Badge
Add a spinner to a badge to indicate a loading state. Place the <Spinner /> before the label with data-icon="inline-start" for a start position, or after the label with data-icon="inline-end" for an end position.
Input Group
Empty
RTL
To enable RTL support in Blazix, see the RTL configuration guide.
Translated with AI for the demo, so it may have mistakes.