termenu

Crates.iotermenu
lib.rstermenu
version2.0.2
sourcesrc
created_at2024-09-30 13:23:38.925164
updated_at2024-10-30 10:36:27.532006
descriptionA fzf-like library for terminal applications
homepage
repositoryhttps://github.com/sshelll/termenu
max_upload_size
id1391707
size50,908
kayce (sshelll)

documentation

README

Termenu

fzf-like terminal ui api for rust

Demo

demo

Examples

check examples folder

# basic example
cargo run --example basic

# complex example
cargo run --example complex

Basic Usage

fn main() {
    let mut menu = termenu::Menu::new().unwrap();
    let mut item_list = Vec::new();
    for i in 1..=10 {
        item_list.push(termenu::Item::new(format!("{}th item", i).as_str(), i));
    }
    let selection = menu
        .set_title("test selection:")
        .add_list(item_list)
        .select()
        .unwrap();
    if let Some(selection) = selection {
        println!("You selected: {}", selection);
    }
}

NOTE

  • Currently, termenu does not support window resizing.
Commit count: 30

cargo fmt