Progress
Represents determinate or indeterminate task progress with composable labels and track.
Loading interactive demo…
progress(0.4, 1.0).w(240.0).h(8.0).rounded(4.0)#Import
Import progress from quickgui.
use quickgui::*;#Usage
progress(0.4, 1.0).w(240.0).h(8.0).rounded(4.0)#Anatomy
progress::rootprogress::trackprogress::indicatorprogress::labelprogress::value
#API reference
Expand an entry for its description and complete signature. A dash means no declaration default is documented.
Progress
View sourcepub fn new(value: f64, maximum: f64) -> SelfCreate a determinate indicator between `0.0` and `maximum`. A non-finite or non-positive maximum falls back to `1.0`; the value is clamped into range.
fractionpub fn fraction(fraction: f64) -> Self—
Create a determinate indicator from a `0.0..=1.0` completion fraction.
pub fn fraction(fraction: f64) -> SelfView sourceindeterminatepub fn indeterminate() -> Self—
value_textpub fn value_text(mut self, text: impl Into<Arc<str>>) -> Self—
Attach a human-readable value such as `"3 of 12 files"`. Assistive technology prefers this over the raw number when present. An empty string clears it. The text is not rendered; the application owns every visible label.
pub fn value_text(mut self, text: impl Into<Arc<str>>) -> SelfView sourceidpub fn id(mut self, id: impl Into<ElementId>) -> Self—
Give this indicator a stable identity so its label and value parts can be related to it. Without an identity the parts are still decorated, but QuickGUI cannot point the root's accessible name and description at them, so the application supplies its own `accessibility_label`. Existing code that never declares an identity is unchanged.
pub fn id(mut self, id: impl Into<ElementId>) -> SelfView sourceformatpub fn format(mut self, format: ValueFormat) -> Self—
Attach a bounded value formatter, Base UI's `format` prop. The result is what [`Self::display_value`] returns for a caller-owned value part, and what assistive technology reads unless [`Self::value_text`] overrides it.
pub fn format(mut self, format: ValueFormat) -> SelfView sourcestatuspub fn status(&self) -> ProgressStatus—
Which of Base UI's three progress states this indicator is in.
pub fn status(&self) -> ProgressStatusView sourcestatepub fn state(&self) -> ProgressPartState—
A copyable snapshot of what Base UI exposes as `data-*` attributes.
pub fn state(&self) -> ProgressPartStateView sourcedisplay_valuepub fn display_value(&self) -> Option<Arc<str>>—
The formatted text for a caller-owned value part, or `None` while indeterminate.
pub fn display_value(&self) -> Option<Arc<str>>View sourceaccessible_valuepub fn accessible_value(&self) -> Option<Arc<str>>—
The text assistive technology reads for the value, if any. An explicit [`Self::value_text`] wins over [`Self::format`], matching Base UI's `getAriaValueText` precedence.
pub fn accessible_value(&self) -> Option<Arc<str>>View sourcelabel_idpub fn label_id(&self) -> Option<ElementId>—
Stable identity of the label part, when this indicator declares one.
pub fn label_id(&self) -> Option<ElementId>View sourcevalue_idpub fn value_id(&self) -> Option<ElementId>—
Stable identity of the value part, when this indicator declares one.
pub fn value_id(&self) -> Option<ElementId>View sourcetrack_idpub fn track_id(&self) -> Option<ElementId>—
Stable identity of the track part, when this indicator declares one.
pub fn track_id(&self) -> Option<ElementId>View sourceindicator_idpub fn indicator_id(&self) -> Option<ElementId>—
Stable identity of the indicator part, when this indicator declares one.
pub fn indicator_id(&self) -> Option<ElementId>View sourcecurrent_valuepub const fn current_value(&self) -> Option<f64>—
maximumpub const fn maximum(&self) -> f64—
is_indeterminatepub const fn is_indeterminate(&self) -> bool—
completionpub fn completion(&self) -> Option<f32>—
The `0.0..=1.0` completion fraction, or `None` while indeterminate. Applications use this to size a caller-owned fill.
pub fn completion(&self) -> Option<f32>View sourceProgress::root_with
View sourcepub fn root_with(&self, root: Element) -> ElementDecorate an application-owned root without adding layout or appearance.
Progress::root
View sourcepub fn root(&self) -> ElementCreate the unstyled root part. Use [`Self::root_with`] to supply an existing element.
Progress::track_with
View sourcepub fn track_with(&self, track: Element) -> ElementDecorate the caller-owned track that the fill is measured inside. The track is decoration: the root already carries the numeric value and bounds, so the track and everything under it stay out of the accessible name.
Progress::track
View sourcepub fn track(&self) -> ElementCreate the unstyled track part. Use [`Self::track_with`] to supply an existing element.
Progress::indicator_with
View sourcepub fn indicator_with(&self, indicator: Element) -> ElementHide an application-owned fill or animation from the accessible name.
Progress::indicator
View sourcepub fn indicator(&self) -> ElementCreate the unstyled indicator part. Use [`Self::indicator_with`] to supply an existing element.
Progress::label_with
View sourcepub fn label_with(&self, label: Element) -> ElementAssign the stable mounted label target the root points at.
Progress::label
View sourcepub fn label(&self) -> ElementCreate the unstyled label part. Use [`Self::label_with`] to supply an existing element.
Progress::value
View sourcepub fn value(&self) -> ElementAssign the stable mounted value target the root points at. Put [`Self::display_value`] inside it; QuickGUI never renders the text itself. Create the unstyled value text part.
Progress::value_with
View sourcepub fn value_with(&self, value: Element) -> Elementprogress
View sourcepub fn progress(value: f64, maximum: f64) -> ElementCreate an unstyled determinate progress root. This shorthand is equivalent to `Progress::new(value, maximum).root_with(div())`.
