Spinners
A spinner is a progress bar without a length. You can use ProgressBar::new_spinner() or
the Spinner wrapper when you prefer spinner-specific method names.
Presets
loaders ships with 27 built-in loading frame presets:
| Name | Frames |
|---|---|
dots | braille dot cycle |
dots2 | heavy braille dot cycle |
dots3 | smooth braille dot cycle |
line | `- \ |
pipe | box pipe cycle |
star | star pulse |
bounce | minimal bounce |
arrows | directional arrows |
clock | clock faces |
earth | globe rotation |
moon | moon phases |
runner | walking/running frames |
pong | moving paddle frames |
shark | swimming text frames |
weather | weather icons |
christmas | tree frames |
toggle | filled/empty square |
square_corners | rotating square corners |
binary | 0 1 10 11 |
meter | ▱▱▱ ▰▱▱ ▰▰▱ ▰▰▰ |
quadrants | ◐ ◓ ◑ ◒ |
triangles | ◢ ◣ ◤ ◥ |
circle | ○ ◔ ◐ ◕ ● |
box_bounce | moving block |
pulse | . .. ... .. |
heart | ♡ ♥ |
progress_blocks | ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ |
Custom Frames
#![allow(unused)] fn main() { use loaders::{ProgressBar, ProgressStyle}; let pb = ProgressBar::new_spinner(); pb.set_style(ProgressStyle::default_spinner().tick_strings(&[".", "o", "O", "o"])); pb.tick(); }
Success and Failure Symbols
#![allow(unused)] fn main() { use loaders::{Spinner, spinner::frames::DOTS}; let spinner = Spinner::with_message(&DOTS, "uploading"); spinner.stop_with_symbol("ok", "uploaded"); }
Convenience helpers provide portable text markers:
#![allow(unused)] fn main() { use loaders::{Spinner, spinner::frames::METER}; let spinner = Spinner::with_message(&METER, "checking"); spinner.success("ready"); }
Use failure, warning, and info for the other common terminal outcomes.
Custom Message and Padding
Spinners use the same template engine as progress bars, so message fields can be padded
or truncated with width specs such as {msg:>20} and {prefix:^10}.
Tick Intervals
Fast terminal spinners usually feel good at 60-120ms. Longer operations with expensive
rendered templates can use 120-250ms. Background ticking is optional; manual tick() is
better when each loop iteration naturally represents progress.