Skip to content

SpinnerWidget

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

Displays an animated spinner to indicate ongoing activity.

csharp
public sealed record SpinnerWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<SpinnerWidget>

Inheritance

ObjectHex1bWidgetSpinnerWidget

Implements

Properties

FrameIndex

Gets the explicit frame index for manual control, or null for time-based animation.

Returns: Nullable<Int32>

csharp
public int? FrameIndex { get; init; }

Style

Gets the explicit spinner style, or null to use the theme's default.

Returns: SpinnerStyle

csharp
public SpinnerStyle? Style { get; init; }

Remarks

SpinnerWidget shows a single animated character (or multi-character sequence) that cycles through frames to indicate ongoing work.

By default, spinners are time-based: the animation runs at the style's suggested interval regardless of how often the screen is redrawn. Use to schedule periodic redraws.

For manual control, set to explicitly control which frame is displayed.

The spinner style can be set explicitly or inherited from the theme via .

Examples

Time-based spinner (recommended):

csharp
ctx.Spinner()
   .RedrawAfter(100); // Redraw periodically; animation is time-based

Spinner with explicit style:

csharp
ctx.Spinner(SpinnerStyle.Arrow)
   .RedrawAfter(100);

Manual frame control:

csharp
ctx.Spinner(SpinnerStyle.Dots, frameIndex: myFrameCounter)

Released under the MIT License.