cli_animate/
lib.rs

1//! # cli-animate
2//!
3//! `cli-animate` is a Rust crate designed to **enrich command-line applications with a variety of beautiful, easy-to-use animations**.
4//! It offers a straightforward way to integrate visual elements such as progress bars, interactive menus, and more, enhancing the interactivity of your CLIs.
5//!
6//! ## Features
7//!
8//! - **Progress Bars**: Show task progress with customizable, animated progress bars.
9//! - **Interactive Menus**: Navigate through options with intuitive, keyboard-navigable menus.
10//! - **Loading Indicators**: Display a loading indicator to show that your application is working.
11//! - **And More**: The library is designed for extensibility and includes a variety of other tools to enrich your CLI applications.
12//!
13//! ## Quick Start
14//!
15//! Add `cli-animate` to your `Cargo.toml` dependencies:
16//!
17//! ```toml
18//! [dependencies]
19//! cli-animate = "0.1.0"
20//! ```
21//!
22//! Here's a simple example of how to use `cli-animate` to create an interactive menu:
23//!
24//! ```rust
25//! use cli_animate::interactive_menu::InteractiveMenu;
26//!
27//! fn main() {
28//!     // Options to display in the user's terminal.
29//!     let options = vec![
30//!       "Tokyo".to_string(),
31//!       "Saitama".to_string(),
32//!       "Kanagawa".to_string(),
33//!      ];
34//!
35//!     // Initialize an interactive menu.
36//!     let mut menu = InteractiveMenu::new(options.clone());
37//!
38//!     // Run the interactive menu.
39//!     let selected_index = menu.run().unwrap();
40//!
41//!     // User is seeing something like this in their terminal:
42//!     //
43//!     // 'w' for up, 's' for down, then press Enter to select. Double Enter to submit.
44//!     //
45//!     // > Tokyo
46//!     //   Saitama
47//!     //   Kanagawa
48//!
49//!    // When the user presses Enter twice, the selected option is returned.
50//!     println!("You selected: {}", options[selected_index]);
51//! }
52//! ```
53//! For more examples, see the folder `examples/` in the [cli-animate GitHub repository](https://github.com/walnut07/cli_animate)!
54//!
55//! ## Feedback and Contributions
56//!
57//! We welcome your feedback and contributions! If you find an issue or have a suggestion for improvement, please file an issue on the [cli-animate GitHub repository](https://github.com/your-github-username/cli-animate).
58//!
59//! Thank you for using `cli-animate` to make your command-line applications more attractive and engaging!
60
61pub mod interactive_menu;
62pub mod loading_indicator;
63pub mod progress;
64pub mod utils;