Feedback

Progress Circle

Show progress along a circular arc.

Rust
1use herogpui::components::progress::ProgressCircle;

Usage

Rust
1use herogpui::prelude::ProgressCircle;
2
3ProgressCircle::new().value(60.)

Live HeroGPUI compiled to WebAssembly. Select any example without loading another WASM instance.

Anatomy

Rust types

ProgressCircle

Progress Circle is assembled from these builders. The API reference lists each one.

Customization

Appearance builders and theme tokens Progress Circle uses.

Styling

Progress Circle styling
StyleDescription
flex + items_center + justify_centerCentered fixed-size root.
size(Size) => 20 / 28 / 36pxPinned desktop diameters are 28px by default, 20px small and 36px large.
border_color(colors.default.color)Full-opacity semantic default track stroke.
stroke_w = size_px / 9Stroke scales to exactly one ninth of the rendered diameter.
PathBuilder::stroke + filled endpoint discsFilled endpoint discs reproduce the SVG arc's round line caps.
direct fraction repaintValue changes redraw immediately because the local canvas has no retained dash-offset transition.
Color::Default => colors.default.foregroundDefault uses the contrasting foreground while other variants use their semantic base color.
PROGRESS_CIRCLE_SPIN_MS + progress_circle_spin_turn + reduce_motionIndeterminate track rotation and its reduced-motion override.

API reference

Builders

Progress Circle builders
BuilderTypeDefaultDescription
value(f32)f320Current progress value, clamped to the configured range.
min_value(f32)f320Minimum value used to normalize progress.
max_value(f32)f32100Maximum value used to normalize progress.
is_indeterminate(bool)boolfalseShows a spinning quarter arc without exposing a value label.
size(Size)SizeSize::MdSelects the 20, 28 or 36px track diameter.
color(Color)ColorColor::AccentSemantic fill-circle stroke color.
format_options(NumberFormat)NumberFormat{style: "percent"}Formats valueText; the local formatter covers common numeric styles without locale or CLDR data.
value_content(render) + show_value_label(true)render) + show_value_label(trueThe local ValueLabel closure receives all three documented values, but arbitrary root children are not composed.
value_content(render)numberNormalized percentage handed to the value renderer.

Parts

Progress Circle parts
PartDescription
ProgressCircleRoot progress indicator and fixed-size layout box.
ProgressCircleSVG track counterpart represented by a border ring and canvas arc; it is not separately composable.
ProgressCircleFull default-color ring beneath the progress arc.
ProgressCircleSemantic-color canvas arc with normalized sweep; custom SVG attributes are unavailable.

States

Progress Circle states
BuilderStateDescription
fraction_of(value, min_value, max_value)DeterminateArc sweep and value renderer follow the normalized value.
is_indeterminate + progress-circle-spin + reduce_motionIndeterminateA quarter arc completes one linear turn per second; reduced motion leaves the same arc static.