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:
The demo shown in the gif can be run with all available symbols.
sh
cargo run --example demo --release
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
// 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);
} ```
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|
This repository's license is zlib. Please feel free to use this, but no warranty.