Module progress

Module progress 

Source
Expand description

Progress component for Bubble Tea applications.

Package progress provides a simple progress bar for Bubble Tea applications. It closely matches the Go bubbles progress component API for 1-1 compatibility.

§Basic Usage

use bubbletea_widgets::progress::{new, with_width, with_solid_fill};

// Create a progress bar with default settings
let progress = new(&[]);

// Create a progress bar with custom settings using the option pattern
let progress = new(&[
    with_width(50),
    with_solid_fill("#ff0000".to_string()),
]);

§Animation and Control

use bubbletea_widgets::progress::new;

let mut progress = new(&[]);

// Set progress (returns command for animation)
let cmd = progress.set_percent(0.75); // 75%
let cmd = progress.incr_percent(0.1); // Add 10%
let cmd = progress.decr_percent(0.05); // Subtract 5%

Structs§

FrameMsg
Message indicating that an animation frame should be processed.
Model
The main progress bar model containing all state and configuration.

Enums§

ProgressOption
Configuration options for customizing progress bar behavior and appearance.

Functions§

new
Creates a new progress bar with the specified configuration options.
new_modelDeprecated
NewModel returns a model with default values. Deprecated: use new instead.
with_default_gradient
Creates a gradient fill with default colors.
with_default_scaled_gradient
Creates a scaled gradient with default colors.
with_fill_characters
Customizes the characters used for filled and empty sections.
with_gradient
Creates a custom gradient fill blending between two specified colors.
with_scaled_gradient
Creates a custom scaled gradient that fits the filled portion width.
with_solid_fill
Sets the progress bar to use a solid color fill.
with_spring_options
Configures the spring animation parameters for smooth progress transitions.
with_width
Sets the total width of the progress bar in characters.
without_percentage
Hides the numeric percentage display.