Throbber Widget¶
Throbber is an animated spinner widget powered by throbber-widgets-tui.
API¶
from pyratatui import Throbber
th = Throbber("Loading")
th.start()
th.stop()
th.set_speed(2)
th.set_style(...)
th.set_throbber_style(...)
th.set_set("clock")
Example¶
from pyratatui import Block, Color, Style, Terminal, Throbber
th = Throbber("Syncing...")
th.set_set("clock")
th.set_throbber_style(Style().fg(Color.cyan()).bold())
with Terminal() as term:
while True:
def ui(frame):
block = Block().bordered().title(" Throbber ")
frame.render_widget(block, frame.area)
frame.render_widget(th, block.inner(frame.area))
term.draw(ui)
ev = term.poll_event(timeout_ms=80)
if ev and ev.code == "q":
break
Symbol Sets¶
Use set_set(name) with:
asciibox_drawingarrowdouble_arrowvertical_blockhorizontal_blockquadrant_blockquadrant_block_crackwhite_squarewhite_circleblack_circleclockbraille_onebraille_sixbraille_six_doublebraille_eightbraille_eight_doubleogham_aogham_bogham_cparenthesiscanadian