ui.spinner
Spinner
Show a spinner while making a request
Example:
from uiwiz import ui
@app.ui("/some/endpoint")
def some_endpoint():
import time
time.sleep(1) # Simulate a long-running request
ui.toast("Button clicked").success()
with ui.button("Click me").on_click(some_endpoint, swap="none") as btn:
ui.spinner(btn)
Constructor
args: ElementNo default required argument
Methods
after_render(html: str) -> str
This method is called after the element is rendered.
:param html: The rendered HTML of the element.
ball() -> Spinner
No documentation providedbars() -> Spinner
No documentation providedbefore_render() -> Any
This method is called before the element is rendered.
classes(input: str) -> Self
Set tailwind classes for the element.
:param input: The tailwind classes to apply to the element.
:return: The current instance of the element.
dots() -> Spinner
No documentation providedextra_small() -> Spinner
No documentation providedget_classes() -> str
Get html classes of the element.
:return: The classes of the element.
:type: str
infinity() -> Spinner
No documentation providedlarge() -> Spinner
No documentation providedmedium() -> Spinner
No documentation providedrender(render_script: bool) -> str
Render the element as HTML.
:param render_script: If any element has a javascript script, it will be rendered as well.
:type render_script: bool
ring() -> Spinner
No documentation providedsize(size: Literal) -> Self
Set the size of the element.
:param size: The size of the element.
:return: The current instance of the element.
small() -> Spinner
No documentation providedspinner() -> Spinner
No documentation provided