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 provided
bars() -> Spinner
No documentation provided
before_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 provided
extra_small() -> Spinner
No documentation provided
get_classes() -> str
Get html classes of the element.
:return: The classes of the element.
:type: str
infinity() -> Spinner
No documentation provided
large() -> Spinner
No documentation provided
medium() -> Spinner
No documentation provided
render(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 provided
size(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 provided
spinner() -> Spinner
No documentation provided
GitHub