Spinner
Indicate a busy state with a rotating arc.
1use herogpui::components::spinner::Spinner;Usage
The indicator keeps its diameter in flex layouts. Turn Motion off to stop rotation.
1use herogpui::prelude::Spinner;
2
3Spinner::new("spinner")Live HeroGPUI compiled to WebAssembly. Select any example without loading another WASM instance.
Anatomy
Rust types
Spinner
Spinner is assembled from these builders. The API reference lists each one.
Customization
Appearance builders and theme tokens Spinner uses.
Styling
| Style | Description |
|---|---|
SpinnerSize::Md + duration_ms(u64) + repeated rotation | The default indicator keeps its 24px diameter in flex layouts and rotates while motion is enabled; duration_ms provides the gallery's speed customization point. |
SpinnerSize::px | All four documented diameters map directly. |
current_color(Hsla) / color(Color) | GPUI SVGs require current text color to be resolved by the caller; semantic roles resolve from the active theme. |
API reference
Builders
| Builder | Type | Default | Description |
|---|---|---|---|
size( | SpinnerSize | SpinnerSize:: | Selects the 16, 24, 32 or 40px indicator size. |
color( | Color / Hsla | Color:: | Selects a semantic color or a caller-resolved current text color. |
Parts
| Part | Description |
|---|---|
Spinner | Rotating arc indicator with semantic color and fixed size. |
States
| Builder | State | Description |
|---|---|---|
Animation::repeat + Transformation::rotate | Spinning | The arc rotates continuously at the configured duration. |