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§
- Frame
Msg - Message indicating that an animation frame should be processed.
- Model
- The main progress bar model containing all state and configuration.
Enums§
- Progress
Option - Configuration options for customizing progress bar behavior and appearance.
Functions§
- new
- Creates a new progress bar with the specified configuration options.
- new_
model Deprecated - 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.