An animated spinner widget. More...
Public Member Functions | |
| void | Render (IRenderContext ctx) |
| Renders the current animation frame (and optional label) into ctx 's allocated region. | |
| Spinner () | |
| Object-initializer constructor. | |
| Spinner (int frame, string? label=null, IReadOnlyList< string >? frames=null, Style? style=null) | |
| Positional constructor for inline usage. | |
Properties | |
| int | Frame [get] |
| Current animation frame index. | |
| IReadOnlyList< string > | Frames = BrailleFrames [get] |
| The animation frames to cycle through. Defaults to BrailleFrames. | |
| SizeConstraint | Height = SizeConstraint.Auto [get] |
| Vertical size constraint. Defaults to SizeConstraint.Auto (single row). | |
| string? | Label [get] |
| Optional label displayed after the spinner frame (e.g. | |
| Style | Style = Style.Default [get] |
| Base style applied to the spinner text. Inherits from the active theme when unset. | |
| SizeConstraint | Width = SizeConstraint.Auto [get] |
| Horizontal size constraint. Defaults to SizeConstraint.Auto (sized to content). | |
An animated spinner widget.
Cycles through a sequence of frames on each render. Models should advance Frame via a Cmd.Tick or Sub.Interval.
The spinner does not self-animate — it renders the frame at index Frame % Frames.Length. Advance Frame in your model's Update handler to produce motion.
| void ConsoleForge.Widgets.Spinner.Render | ( | IRenderContext | ctx | ) |
Renders the current animation frame (and optional label) into ctx 's allocated region.
Content is truncated to fit the available width.
| ctx | The render context providing the target region, theme, and write methods. |
Implements ConsoleForge.Layout.IWidget.
|
get |
Current animation frame index.
The spinner renders Frames[Frame % Frames.Length]. Increment this in your model to advance the animation.
|
get |
Optional label displayed after the spinner frame (e.g.
"Loading…"). A single space is inserted between the frame and the label.