Feedback

Progress

Show a changing value with an eased, CSS-styled progress bar.

Open ↗
Progress interaction recorded with the Blinc headless renderer
Hybrid · dark · native recording · 2×

Usage and properties

Bind a value, Signal or Computed. Progress does not own a task or timer; application state supplies the percentage. Use progress_indeterminate() when no percentage is available.

Use the installation guide to add blinc_cn and its component stylesheet. Create the fixture bindings once, and return the demo from your UI builder. Values marked Bound accept Signal/Computed sources where the API supports them; structural options configure the component at construction.

PropertyTypeUpdate modelThis example
valuef32Bound42 (0–100)
sizeProgressSizeStructuralMedium
wf32StructuralContainer width, up to 256 logical pixels
progress_indeterminate()BuilderStructural alternativeNot used in this example

Keyboard and interaction

[data-indeterminate] on the track enables the indeterminate animation. A progress bar is informational and is not a keyboard stop; the example button advances it.

Customizing it

Add application CSS after the default component layer. These selectors are the restyling surface for this component:

  • .cn-progress
  • .cn-progress-bar
  • .demo-caption

Theme and component variables: --cn-progress-track, --cn-progress-bar, --border, --primary, --radius-full, --duration-slow, --ease-nav.

Built-in themes

The Live theme control installs Blinc's own theme bundles, including their colours, focus rings, corner shapes and motion tokens.

pub fn theme_bundle_for(name: &str) -> blinc_theme::ThemeBundle {
    match name {
        "restrained" => blinc_theme::RestrainedTheme::bundle(),
        "expressive" => blinc_theme::ExpressiveTheme::bundle(),
        _ => blinc_theme::HybridTheme::bundle(),
    }
    .with_css(blinc_cn::cn_styles::CN_STYLES)
}

Download the default widget and component stylesheets. Sample assets and licenses are available in the asset guide.

Documentation

From the canonical component guide.

Values are in the 0..=100 range:

progress(75.0)

Bound to a Signal

An f32, Signal<f32> or Computed<f32> can drive the bar. Bound values change in place and ease by the transition on .cn-progress-bar:

let pct = ctx.use_signal(0.0_f32);

div()
    .child(progress(pct).w(300.0))
    .child(button("Advance").on_click(move |_| {
        pct.update(|value| (value + 10.0).min(100.0));
    }))

Indeterminate

For work of unknown length:

progress_indeterminate().w(300.0)

The track is .cn-progress, with data-size and, when applicable, data-indeterminate. The bar is .cn-progress-bar. Their colours read --cn-progress-track and --cn-progress-bar; the transition and cn-progress-pulse keyframes control motion.

With a Label

use blinc::core::reactive::computed;

let pct = ctx.use_signal(0.0_f32);
let shown = computed(move |graph| format!("{}%", graph.get(pct).unwrap_or(0.0) as i32));

div().flex_col().gap(1.0)
    .child(div().flex_row().justify_between()
        .child(label("Uploading"))
        .child(label(shown)))
    .child(progress(pct))

Platforms and version

The component API is available in Blinc 0.6.0. The Live example runs in a dedicated worker and requires a compatible GPU surface. Preview and Code remain available when Live cannot start. The canvas has a descriptive label; a full screen-reader DOM mirror is not provided. The gallery integration is based on revision e2e55c24e078.

Recordings and live demos use the default Hybrid theme with bundled Noto Sans. The recording uses a 560 × 320 logical viewport at twice that resolution. Live follows its container and actual display density. Source base revision · Exact build source · Artifact versions and checksums · Font license.