Expand description
A fzf-like library for terminal applications
You can use it to build a menu for selecting items from a list in terminal with ui. It supports both normal mode and query mode, and you can customize the colorscheme.
§Demo
§Key Mapping
j
/k
ordown
/up
to move the cursorenter
to select the item/
to enter query mode just like vimctrl-n
/ctrl-p
to move the cursor in query modeesc
to exit query mode or the menuctrl-c
to exit the menu
§Examples
let mut menu = termenu::Menu::new().unwrap();
let mut item_list = Vec::new();
for i in 1..=10 {
item_list.push(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);
}
Check the examples folder for more details.
Structs§
- Color
Scheme - colorscheme of the menu
- Font
Style - style of font
- Item
- item in the menu
- Menu
- the menu itself
Enums§
- Font
Shape - Italic, Bold, Underline