class RatatuiRuby::LineGauge
Displays a compact, single-line progress bar.
Screen space is precious. Standard block gauges are bulky and consume multiple rows.
This widget compresses the feedback. It draws a progress bar using line characters, fitting perfectly into tight layouts or lists.
Use it when you need to show status without stealing focus or space.
Example
Run the interactive demo from the terminal:
ruby examples/widget_line_gauge/app.rb
Attributes
Optional wrapping block.
Style for the completed portion.
Character for filled segments.
Optional label (String or Text::Span for rich styling).
Progress ratio from 0.0 to 1.0.
Base style applied to the entire gauge.
Style for the remainder.
Character for empty segments.
Public Class Methods
Source
# File lib/ratatui_ruby/schema/line_gauge.rb, line 67 def initialize(ratio: 0.0, label: nil, style: nil, filled_style: nil, unfilled_style: nil, block: nil, filled_symbol: "β", unfilled_symbol: "β") super( ratio: Float(ratio), label:, style:, filled_style:, unfilled_style:, block:, filled_symbol:, unfilled_symbol: ) end
Creates a new LineGauge.
- ratio
-
Float (0.0 - 1.0).
- label
-
String or
Text::Span(optional). - style
-
Style(optional, base style for the gauge). filled_styleunfilled_style- block
filled_symbol-
String (default:
"β"). unfilled_symbol-
String (default:
"β").
