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:

NameFrames
dotsbraille dot cycle
dots2heavy braille dot cycle
dots3smooth braille dot cycle
line`- \
pipebox pipe cycle
starstar pulse
bounceminimal bounce
arrowsdirectional arrows
clockclock faces
earthglobe rotation
moonmoon phases
runnerwalking/running frames
pongmoving paddle frames
sharkswimming text frames
weatherweather icons
christmastree frames
togglefilled/empty square
square_cornersrotating square corners
binary0 1 10 11
meter▱▱▱ ▰▱▱ ▰▰▱ ▰▰▰
quadrants◐ ◓ ◑ ◒
triangles◢ ◣ ◤ ◥
circle○ ◔ ◐ ◕ ●
box_bouncemoving 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.