Progress Bars
Animated single-bar progress with percentage, ETA, elapsed time, and rate display. Auto-sizes to terminal width. Determinate and indeterminate modes.
High-performance, thread-safe progress bars, spinners, and multi-progress UIs for Zig CLI applications. Zero external dependencies. Cross-platform.
Stable release (production):
zig fetch --save https://github.com/muhammad-fiaz/loaders.zig/archive/refs/tags/0.0.1.tar.gzNightly (latest main):
zig fetch --save git+https://github.com/muhammad-fiaz/loaders.zig.gitconst std = @import("std");
const loaders = @import("loaders");
pub fn main(init: std.process.Init) !void {
const io = init.io;
var bar = loaders.Bar.init(io, .{
.label = "Processing",
.total = 100,
.show_percent = true,
.show_elapsed = true,
});
defer bar.done();
for (0..100) |i| {
bar.setCompleted(i + 1);
bar.render();
try io.sleep(std.Io.Duration.fromMilliseconds(30), .awake);
}
}