Find a file
2022-07-19 21:05:17 +02:00
.github new: Issue templates 2022-07-15 21:31:40 +02:00
assets fix: add more colors to doc examples 2022-07-19 19:18:13 +02:00
examples new: version 0.4.0 2022-07-19 20:01:23 +02:00
src new: version 0.4.0 2022-07-19 20:01:23 +02:00
.gitignore Initial commit 2022-07-15 19:59:22 +02:00
Cargo.toml new: version 0.4.0 2022-07-19 20:01:23 +02:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2022-07-18 16:40:52 +02:00
LICENSE Initial commit 2022-07-15 19:59:22 +02:00
README.md fix: Fixed link in README 2022-07-19 21:05:17 +02:00

spinoff

spinoff is a simple to use library for displaying spinners in the terminal, with plenty of features and options.

Version Downloads Docs License Actions

Usage

use spinoff::{Spinner, Spinners, Color};
use std::thread::sleep;
use std::time::Duration;

let spinner = Spinner::new(Spinners::Dots, "Loading...", Color::Blue); 
sleep(Duration::from_secs(3));
spinner.success("Done!");

Update a spinner

use spinoff::{Spinner, Spinners, Color};
use std::thread::sleep;
use std::time::Duration;

let mut spinner = Spinner::new(Spinners::Dots, "Loading...", Color::Red); 
sleep(Duration::from_secs(3));
spinner.update(Spinners::Dots2, "Loading...", None);
sleep(Duration::from_secs(3));
spinner.stop()

Stop a spinner and persist a symbol and message

use spinoff::{Spinner, Spinners, Color};
use std::thread::sleep;
use std::time::Duration;

let mut spinner = Spinner::new(Spinners::Dots, "Loading...", Color::Green);
sleep(Duration::from_secs(3));
spinner.stop_and_persist("📜", "Task done.");

Other examples can be found in the documentation.

📖 Documentation

  • All relevant documentation can be found on the Docs.rs page.
  • If you want to see all the available Spinner options, check the Spinners 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 a pull request. If you like the project, star this project on GitHub.

📑 License

This crate is licensed under the MIT license.