line-ui

Crates.ioline-ui
lib.rsline-ui
version0.5.0
created_at2025-10-25 02:54:43.466967+00
updated_at2025-10-30 22:26:05.132998+00
descriptionLine-based UI with termion
homepage
repositoryhttps://github.com/j-tai/line-ui
max_upload_size
id1899603
size59,413
Jasmine Tai (j-tai)

documentation

https://docs.rs/line-ui/latest/line_ui/

README

line-ui

Line-based TUI library, using termion.

Example

use line_ui::{Renderer, Style};
use line_ui::element::*;
use termion::input::TermRead;
use termion::raw::IntoRawMode;

fn main() -> std::io::Result<()> {
    let stdout = std::io::stdout().into_raw_mode()?;
    let mut r = Renderer::new(stdout);

    r.reset()?
        .render((
            "left".into_element(),
            "fixed width".fixed_width(20).styled(Style::INVERT),
            "right".into_element(),
        ))?
        .render("Press any key to continue!".into_element())?
        .finish()?;

    let _ = std::io::stdin().events().next();
    Ok(())
}

License

MIT

Commit count: 0

cargo fmt