Crate console_menu

source ·
Expand description

A simple yet powerful library for creating beautiful console menus in rust.

Allows for easy creation of interactive console menus. A simple example:

use console_menu::{Menu, MenuOption, MenuProps};
 
let menu_options = vec![
    MenuOption::new("option 1", || println!("option one!")),
    MenuOption::new("option 2", || println!("option two!")),
    MenuOption::new("option 3", || println!("option three!")),
];
let mut menu = Menu::new(menu_options, MenuProps::default());
menu.show();

Menus can include a title, footer message, and any combination of 8-bit colored backgrounds and text by configuring MenuProps. Menus that don’t fit the console window are paginated.

Menu controls are as follows:

Key BindAction
↓, ↑, ←, →, h, j, k, lmake selection
enterconfirm
esc, qexit

Structs§

  • Interactive console menu.
  • An element in a Menu.
  • Stores configuration data passed to a Menu on creation.