1 unstable release

0.1.0 Jun 1, 2022

#80 in #label

MIT/Apache

105KB
2.5K SLoC

Semtext is a Rust library for building text user interfaces, or TUIs.


lib.rs:

Semtext is a Rust library for building text user interfaces, or TUIs.

Example

use semtext::{grid_area, input::Action, widget::Label, Screen, Widget};

async fn async_main() -> Result<(), Box<dyn std::error::Error>> {
    let mut screen = Screen::new()?;
    let a = Label::new("Hello!").into_button();
    let grid = grid_area!(
        [. . .]
        [. a .]
        [. . .]
    )?;
    while screen.step(&grid).await? != Action::Quit() {}
    Ok(())
}

fn main() -> Result<(), Box<dyn std::error::Error>> {
    futures::executor::block_on(async_main())
}

Dependencies

~3–13MB
~94K SLoC