Class ProgressBar
Single-line progress bar that redraws in place via carriage return. Use
once via using var bar = ProgressBar.Start(total); — disposing
finishes the bar (full fill + newline).
public sealed class ProgressBar : IDisposable
- Inheritance
-
ProgressBar
- Implements
- Inherited Members
Properties
Total
public long Total { get; }
Property Value
Value
public long Value { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Set(long)
public void Set(long value)
Parameters
valuelong
Start(long, int, string?, Color?, bool)
Begin a new progress bar and render the empty frame.
public static ProgressBar Start(long total, int width = 30, string? label = null, Color? color = null, bool showPercent = true)
Parameters
totallongTotal work units the bar represents (≥1).
widthintBar cells. Defaults to 30. Pass FillWidth to span the terminal — the bar sizes itself to the available space after subtracting the label and percent suffix. Clamped to
[1, ProgressBarRenderer.MaxWidth].labelstringOptional text written before the bar, with a single trailing space. Falls back to no label when null.
colorColor?Optional foreground for the bar fill. When null, falls back to the active theme's accent slot, or no color if no theme is active.
showPercentboolAppend a 5-character percent suffix (
" ddd%") to every frame. Defaults to true.
Returns
Tick(long)
public void Tick(long delta = 1)
Parameters
deltalong