beamtea_progress (beamtea v0.1.2)
View SourceA bubble: a horizontal progress bar with an electric gradient.
Stateless with respect to time — set the percentage (0.0–1.0) from your own model and render. Pair it with a beamtea:every/2 timer to animate.
P0 = beamtea_progress:new(#{width => 40}),
P1 = beamtea_progress:set(0.42, P0),
beamtea_progress:view(P1) %% => "██████░░░░░ 42%"
Summary
Functions
Add Delta to the current fraction (clamped).
Options: width (default 40), full/empty glyphs, gradient ({FromRGB, ToRGB}, each an {R,G,B} triple — interpolated in 24-bit truecolor), empty_color (xterm-256 index), show_percent.
The current fraction.
Set the fill fraction, clamped to [0.0, 1.0].
Render the bar (with a trailing percentage unless disabled).
Types
Functions
Add Delta to the current fraction (clamped).
-spec new() -> model().
Equivalent to new(#{}).
Options: width (default 40), full/empty glyphs, gradient ({FromRGB, ToRGB}, each an {R,G,B} triple — interpolated in 24-bit truecolor), empty_color (xterm-256 index), show_percent.
The current fraction.
Set the fill fraction, clamped to [0.0, 1.0].
Render the bar (with a trailing percentage unless disabled).