Feedback

Spinner

Indicate a busy state with a rotating arc.

Rust
1use herogpui::components::spinner::Spinner;

Usage

The indicator keeps its diameter in flex layouts. Turn Motion off to stop rotation.

Rust
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

Spinner styling
StyleDescription
SpinnerSize::Md + duration_ms(u64) + repeated rotationThe 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::pxAll 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

Spinner builders
BuilderTypeDefaultDescription
size(SpinnerSize)SpinnerSizeSpinnerSize::MdSelects the 16, 24, 32 or 40px indicator size.
color(Color) / current_color(Hsla)Color / HslaColor::AccentSelects a semantic color or a caller-resolved current text color.

Parts

Spinner parts
PartDescription
SpinnerRotating arc indicator with semantic color and fixed size.

States

Spinner states
BuilderStateDescription
Animation::repeat + Transformation::rotateSpinningThe arc rotates continuously at the configured duration.