Skip to main content

linear_wavy_progress_indicator

Function linear_wavy_progress_indicator 

Source
pub fn linear_wavy_progress_indicator() -> LinearWavyProgressIndicatorBuilder
Expand description

§linear_wavy_progress_indicator

Show completion or ongoing work with an expressive linear waveform.

§Usage

Indicate a download, upload, or background operation with known or unknown duration.

§Parameters

  • progress — completion in 0.0..=1.0; omit for an indeterminate animation.
  • modifier — placement and size; defaults to 240dp by 10dp.
  • color, track_color — optional active and inactive colors.
  • stroke_width, track_stroke_width — independent stroke widths; default to 4dp.
  • stroke_cap, track_stroke_cap — active and inactive caps; default to rounded.
  • amplitude — wave height fraction in 0.0..=1.0; defaults to full height, flattening at progress at or below 10% and at or above 95%.
  • wavelength — wave length; defaults to 40dp for known progress and 20dp otherwise.
  • wave_speed — distance traveled per second; defaults to one wavelength. Zero stops wave travel while indeterminate progress can continue.
  • gap_size, stop_size — track spacing and determinate stop diameter; both default to 4dp, and a zero stop diameter hides the stop.
  • paused — freeze motion and stop animation frame requests; changed appearance parameters still apply immediately.
  • reverse_direction — rotate the indicator by 180 degrees for reverse flow.
  • accessibility_label, accessibility_description — localized task information.

§Examples

use tessera_components::{
    theme::material_theme,
    wavy_progress::{WavyProgressIndicatorDefaults, linear_wavy_progress_indicator},
};
use tessera_ui::tessera;

assert_eq!(
    WavyProgressIndicatorDefaults::indicator_amplitude(0.05),
    0.0
);
assert_eq!(WavyProgressIndicatorDefaults::indicator_amplitude(0.5), 1.0);
#[tessera]
fn content() {
    material_theme().child(|| {
        linear_wavy_progress_indicator().progress(0.5).paused(true);
    });
}