Skip to content

penso/ratatui-braille-bar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ratatui-braille-bar

CI Crates.io License: MIT

Once-style braille progress bars for ratatui.

Inspired by Basecamp's Once dashboard meters.

Demo

Features

  • Braille characters with rounded end caps ( / )
  • Optional peak marker (e.g. max CPU over a sliding window)
  • Three visual states: filled, peak, empty
  • Auto-sizes to area.width — no manual width needed
  • Implements ratatui::Widget
  • Also exposes into_line() for composing into larger widgets
  • BrailleSpinner — random braille dot pattern for indeterminate/loading states

Usage

use ratatui::style::Color;
use ratatui_braille_bar::BrailleBar;

// As a Widget (auto-sizes to area)
frame.render_widget(
    BrailleBar::new(62.0, 100.0)
        .peak(78.0)
        .fill_color(Color::Rgb(99, 102, 241)),
    area,
);

// As a Line (for composing)
let line = BrailleBar::new(0.42, 1.0)
    .fill_color(Color::Green)
    .into_line(30);

// Random braille spinner (re-render each frame for animation)
use ratatui_braille_bar::BrailleSpinner;
frame.render_widget(
    BrailleSpinner::new().color(Color::Rgb(99, 102, 241)),
    area,
);

Run the example

cargo run --example dashboard

License

MIT

About

Once-style braille progress bars for Ratatui

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors