Spinner
Description
The Spinner component is a visual indicator that displays an animated circle outline, suggesting that a background process is running. It is commonly used when the duration of the task is unknown, serving as an indeterminate progress indicator. The Spinner supports various sizes and allows positioning of an associated label to provide additional context (for example, "Loading...", "Saving...", etc.). It is part of the Progress group in Tesserae's UI components.
Usage
Instantiate the Spinner component using the Tesserae.UI helper methods. You can create a spinner with initial text and further customize its size and label position. The following sample demonstrates a basic usage:
API reference
public class Spinner : ComponentBase<Spinner, HTMLDivElement>A spinner component used to indicate loading states.
Constructors
Properties
public LabelPosition Position { get ; set ; }Gets or sets the position of the label.
Methods
public Spinner Success()Sets the spinner to indicate success.
Returns
The current instance.
public Spinner Danger()Sets the spinner to indicate danger/error.
Returns
The current instance.
public Spinner Primary()Sets the spinner to the primary color.
Returns
The current instance.
public Spinner CustomColor(string color)Configures the custom color on the component.
public Spinner Progress(int position, int total)Sets the progress position (between 0 and total).
Parameters
- position
- The current position.
- total
- The total amount.
Returns
The current instance.
public Spinner Progress(float percent)Sets the progress percentage (between 0 and 100).
Parameters
- percent
- The percentage.
Returns
The current instance.
public Spinner Indeterminate()Sets the spinner back to the normal indeterminate state.
Returns
The current instance.
public override HTMLElement Render()Renders the component.
Returns
The rendered HTML element.