.github | ||
examples | ||
src | ||
.gitignore | ||
Cargo.toml | ||
LICENSE | ||
README.md |
spinoff
spinoff
is a simple to use library for displaying spinners in the terminal, with plenty of features and options.
Usage
use spinoff::Spinners;
use std::thread::sleep;
use std::time::Duration;
let spinner = spinoff::new(Spinners::Dots, "Loading...", "blue".into()); // Can also be Some("blue") or None
sleep(Duration::from_secs(3));
spinner.success("Done!");
Update a spinner
use spinoff::Spinners;
use std::thread::sleep;
use std::time::Duration;
let mut spinner = spinoff::new(Spinners::Dots, "Loading...", "blue".into());
sleep(Duration::from_secs(3));
spinner = spinner.update(Spinners::Dots2, "Loading...", None);
sleep(Duration::from_secs(3));
spinner.stop_and_persist("👨💻", "Done!");
Documentation
- All documentation can be found on the Docs.rs page.
- If you want to see all the available
Spinner
options, check theSpinners
enum.
Examples
To run some of the included examples, use:
cargo run --example all_spinners
cargo run --example simple
Contributing
Any contributions to this crate are highly appreciated. If you have any ideas/suggestions/bug fixes, please open an issue or pull request.
License
This crate is licensed under the MIT license.