#ratatui #tui #terminal #template #book #copied

ratatui-template

Base TUI struct with backend in ratatui; copied from Ratatui Book: https://ratatui.rs/how-to/develop-apps/abstract-terminal-and-event-handler.html

1 unstable release

0.1.1 Oct 27, 2023

#755 in Command-line interface

MIT license

15KB
199 lines

Base TUI template

Almost completely copied from the Ratatui Book.

Any author credentials belong to the Ratatui team. This repository does not claim any ownership over the source code.

Getting started

Add the dependency to the Cargo.toml:

ratatui-template = "0.1.1"

And then simply include it into your Rust TUI app:

use ratatui_template::Tui;

#[tokio::main]
async fn main() -> color_eyre::Result<()> {
    let mut interface = Tui::new()?;
    
    interface.enter()?;
    loop {
        // implement application loop
    }
    interface.exit()?;
}

Note: async features are powered by tokio.

Building

Built as a Rust lib, you know the drill:

cargo build

The project requires Rust 1.73.0 or later.

Dependencies

~12–20MB
~244K SLoC