Throbber widget of [tui-rs]

NOTE: I'm a newbie Rust. Therefore, there may be breaking changes in the future.

throbber-widgets-tui is a [tui-rs] widget that displays throbber.

A throbber may also be called:

Demo

Demo Animation

The demo shown in the gif can be run with all available symbols.

sh cargo run --example demo --release

Features

Getting Started

throbber-widgets-tui MSRV is 1.56.1.

sh cargo add throbber-widgets-tui

```rust // : // : struct App { throbberstate: throbberwidgetstui::ThrobberState, } impl App { fn ontick(&mut self) { self.throbberstate.calcnext(); } } // : // : fn ui(f: &mut tui::Frame, app: &mut App) { let chunks = tui::layout::Layout::default() .direction(tui::layout::Direction::Horizontal) .margin(1) .constraints( [ tui::layout::Constraint::Percentage(50), tui::layout::Constraint::Percentage(50), ] .as_ref(), ) .split(f.size());

// Simple random step
let simple = throbber_widgets_tui::Throbber::default();
f.render_widget(simple, chunks[0]);

// Set full with state
let full = throbber_widgets_tui::Throbber::default()
    .label("Running...")
    .style(tui::style::Style::default().fg(tui::style::Color::Cyan))
    .throbber_style(tui::style::Style::default().fg(tui::style::Color::Red).add_modifier(tui::style::Modifier::BOLD))
    .throbber_set(throbber_widgets_tui::CLOCK)
    .use_type(throbber_widgets_tui::WhichUse::Spin);
f.render_stateful_widget(full, chunks[1], &mut app.throbber_state);

} ```

Apps using throbber-widgets-tui

Dependencies

Direct dependencies crates:

sh cargo license --direct-deps-only --avoid-build-deps --avoid-dev-deps | awk -F ":" 'BEGIN {printf "|License|crate|\n|-|-|\n"} {printf "|%s|%s|\n", $1, $2}'

|License|crate| |-|-| |Apache-2.0 OR MIT (1)| rand| |MIT (2)| crossterm, tui| |Zlib (1)| throbber-widgets-tui|

Chain dependencies crates:

sh cargo license --avoid-build-deps --avoid-dev-deps | awk -F ":" 'BEGIN {printf "|License|crate|\n|-|-|\n"} {printf "|%s|%s|\n", $1, $2}'

|License|crate| |-|-| |Apache-2.0 OR Apache-2.0 WITH LLVM-exception OR MIT (1)| wasi| |Apache-2.0 OR MIT (31)| bitflags, cassowary, cfg-if, getrandom, libc, lockapi, log, parkinglot, parkinglotcore, ppv-lite86, rand, randchacha, randcore, scopeguard, signal-hook, signal-hook-mio, signal-hook-registry, smallvec, unicode-segmentation, unicode-width, winapi, winapi-i686-pc-windows-gnu, winapi-x8664-pc-windows-gnu, windows-sys, windowsaarch64gnullvm, windowsaarch64msvc, windowsi686gnu, windowsi686msvc, windowsx8664gnu, windowsx8664gnullvm, windowsx8664msvc| |MIT (5)| crossterm, crosstermwinapi, mio, redoxsyscall, tui| |Zlib (1)| throbber-widgets-tui|

License

This repository's license is zlib. Please feel free to use this, but no warranty.