Skip to main content

Gauge / LineGauge

Two flavours of progress bar: a multi-row block gauge and a single-row line gauge.

Gauge (block fill)

tui.widgets.Gauge{
.ratio = 0.72, // 0.0 – 1.0
.label = "72%",
.gauge_style = .{ .fg = .green },
}.render(area, buf);

LineGauge (single row)

tui.widgets.LineGauge{
.ratio = 0.5,
.label = "50%",
.gauge_style = .{ .fg = .blue },
.line_set = .rounded, // .default .thick .double .rounded
}.render(area, buf);

Fields

FieldTypeDescription
ratiof64Progress value between 0.0 and 1.0
label?[]const u8Text drawn in the centre of the bar
gauge_styleStyleStyle of the filled portion
line_setLineSetLineGauge only glyph set for the bar