Skip to content

ProgressBar

ProgressBar() renders indeterminate progress. Pass a normalized value for determinate progress.

Choose determinate or indeterminate progress

Section titled “Choose determinate or indeterminate progress”
Column {
ProgressBar(),
ProgressBar(download_progress),
Text::Format("Downloaded {}%", static_cast<int>(download_progress * 100.0F)),
}.With(Spacing(8.0F))

The caller owns the progress value. The component does not start work, poll a task, or mutate a supplied State<float>.

Progress-indicator semantics distinguish determinate range values from indeterminate busy state. Add a semantic label when surrounding text does not name the operation.

ProgressBarStyle controls width, height, track and indicator colors, corner radius, gaps, stop indicator, indeterminate motion, segment fraction, and duration. Material and Flat themes can choose different sweep or segmented motion.

  • Constructors: ProgressBar(), ProgressBar(float), ProgressBar(State<float>).
  • Common modifiers: Frame, Grow, Opacity, Semantics.
  • Theme style: ProgressBarStyle and ProgressBarIndeterminateMotion.

Use ProgressCircle when a compact circular indicator fits the surrounding layout better.

All constructors are in huxerui, <huxerui/view.h>. ProgressBar() means unknown completion; ProgressBar(0.0F) means known zero completion. Supplying a value does not install a timer or change handler. Feed a fraction, not a percentage: 35 percent is 0.35F.

ProgressBarStyle field Effect
width, height Preferred linear dimensions.
track_color, indicator_color Unfinished and completed/animated parts.
corner_radius, track_gap Rounded segment ends and separation.
stop_indicator_size Endpoint marker size; zero hides it.
indeterminate_motion Sweep for a moving segment or Segmented for the built-in multi-segment sequence.
indeterminate_fraction Moving width for Sweep; Segmented defines its own extents.
animation_duration Indeterminate cycle duration in seconds.

Material selects segmented motion, gaps, and an endpoint marker; Flat selects a simple sweep. Use the same component identity when switching from unknown to known progress. The task/request owns cancellation and errors; pair the indicator with status text and a separate Cancel action rather than encoding errors as negative progress.