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

class

Spinner

public class Spinner : ComponentBase<Spinner, HTMLDivElement>

A spinner component used to indicate loading states.

Namespace
Tesserae
Inheritance
ComponentBase<Spinner, HTMLDivElement> → Spinner

Constructors

NameDescription
SpinnerInitializes a new instance of the Spinner class.
Constructor
Spinner
public Spinner(string text = string.Empty)

Initializes a new instance of the Spinner class.

Parameters

text
The label text.

Properties

NameDescription
PositionGets or sets the position of the label.
SizeGets or sets the size of the spinner.
TextGets or sets the label text.
Property
Spinner.Position
public LabelPosition Position { get ; set ; }

Gets or sets the position of the label.

Property
Spinner.Size
public CircleSize Size { get ; set ; }

Gets or sets the size of the spinner.

Property
Spinner.Text
public string Text { get ; set ; }

Gets or sets the label text.

Methods

NameDescription
SuccessSets the spinner to indicate success.
DangerSets the spinner to indicate danger/error.
PrimarySets the spinner to the primary color.
CustomColorConfigures the custom color on the component.
ProgressSets the progress position (between 0 and total).
IndeterminateSets the spinner back to the normal indeterminate state.
RenderRenders the component.
LeftSets the label position to left.
RightSets the label position to right.
AboveSets the label position to above.
BelowSets the label position to below.
XSmallSets the size to extra small.
SmallSets the size to small.
MediumSets the size to medium.
LargeSets the size to large.
SetTextSets the label text.
Method
Spinner.Success
public Spinner Success()

Sets the spinner to indicate success.

Returns

The current instance.

Method
Spinner.Danger
public Spinner Danger()

Sets the spinner to indicate danger/error.

Returns

The current instance.

Method
Spinner.Primary
public Spinner Primary()

Sets the spinner to the primary color.

Returns

The current instance.

Method
Spinner.CustomColor
public Spinner CustomColor(string color)

Configures the custom color on the component.

Method
Spinner.Progress
Overload
Progress(int, int)Sets the progress position (between 0 and total).
Progress(float)Sets the progress percentage (between 0 and 100).
Progress(int, int)
public Spinner Progress(int position, int total)

Sets the progress position (between 0 and total).

Parameters

position int
The current position.
total int
The total amount.

Returns

The current instance.

Progress(float)
public Spinner Progress(float percent)

Sets the progress percentage (between 0 and 100).

Parameters

percent float
The percentage.

Returns

The current instance.

Method
Spinner.Indeterminate
public Spinner Indeterminate()

Sets the spinner back to the normal indeterminate state.

Returns

The current instance.

Method
Spinner.Render
public override HTMLElement Render()

Renders the component.

Returns

The rendered HTML element.

Method
Spinner.Left
public Spinner Left()

Sets the label position to left.

Method
Spinner.Right
public Spinner Right()

Sets the label position to right.

Method
Spinner.Above
public Spinner Above()

Sets the label position to above.

Method
Spinner.Below
public Spinner Below()

Sets the label position to below.

Method
Spinner.XSmall
public Spinner XSmall()

Sets the size to extra small.

Method
Spinner.Small
public Spinner Small()

Sets the size to small.

Method
Spinner.Medium
public Spinner Medium()

Sets the size to medium.

Method
Spinner.Large
public Spinner Large()

Sets the size to large.

Method
Spinner.SetText
public Spinner SetText(string text)

Sets the label text.

Parameters

text
The text.

Returns

The current instance.

Samples

Various Spinner Sizes

Spinner with Label Positioning

See also

© 2026 Curiosity. All rights reserved.