Skip to content

Progress

Show a finite amount of completed work.

On this page

Available with egui, Masonry and GPUI through the same public component API. Platform input and accessibility coverage still have alpha limits.

Usage

Replace src/App.iru in a scaffolded project with this complete file, then run cargo run. Keep the scaffold's main.rs and build.rs; this file includes its state, handlers and scoped styles.

src/App.iru
<view>
    <Column class="example">
        <Progress label="Download progress" value={completed} max={100.0} class="range" />
        <Text text={format!("Completed: {}%", completed.get())} />
        <Row class="actions">
            <Button text="Advance" @click={advance} disabled={finished} class="action" />
            <Button text="Reset" @click={reset} />
        </Row>
    </Column>
</view>
<rust>
use inrux::prelude::*;

let completed: Signal<f64> = Signal::new(25.0);
let source = completed.clone();
let finished: Computed<bool> = Computed::new(move || source.get() >= 100.0);

/// Keep progress within its declared finite bounds.
fn advance(state: &mut State, _: &Context<State>) {
    state
        .completed
        .update(|value| *value = (*value + 10.0).min(100.0));
}
/// Start a new progress cycle.
fn reset(state: &mut State, _: &Context<State>) {
    state.completed.set(0.0);
}
</rust>
<style scoped>
.example {
    padding: 24px;
    gap: 16px;
}
.actions {
    gap: 8px;
}
.action {
    background: #b84200;
    color: white;
    padding: 12px;
    border-radius: 6px;
}
.action:hover {
    background: #913400;
}
.action:focus-visible {
    border-width: 2px;
    border-color: #262626;
}
.range {
    height: 16px;
    accent-color: #b84200;
}
</style>

API Reference

Props

PropTypeDefaultDescription
labelString-like expressionRequiredNonempty description of the task.
valuef64RequiredFinite completion value, normalized to the declared range.
maxf64RequiredFinite positive upper bound; lower bound is zero.

Common props

PropTypeDefaultDescription
idString-like expressionNot setStyle-selector identity; independent of retained mount identity.
classString-like expressionNot setWhitespace-separated stylesheet classes.
styleStyleNot setExplicit Rust style overrides for this node.
keyString-like expressionNot setRetained sibling identity; preserve it while reordering children.
widthSizeComponent styleExplicit width constraint; otherwise use the resolved style.
heightSizeComponent styleExplicit height constraint; otherwise use the resolved style.
paddingf32Component styleUniform padding in logical pixels; otherwise use the resolved style.
gapf32Component styleChild spacing in logical pixels; otherwise use the resolved style.

“Component style” means the attribute is omitted and the normal style cascade supplies the value. Application styles can override framework defaults.

Emits

EventPayloadDescription
——No component events are emitted.

Behavior

Progress is a readout, not an interactive range input. Values must be finite and within the valid range. An invalid descriptor fails validation before native rendering. Indeterminate progress is not part of this API.

Styling and limits

The root forms the track; ::part(indicator) controls fill paint/radius. Use inherited accent-color for a shared control accent. Custom visuals do not establish complete accessible announcement support.

Read the detailed reference for validation and native integration details. The playgrounds include a working Progress specimen with its surrounding state and reset controls.

Inrux · Built with Nuxt Content, IPEX, and Akaza UI.