ui.toast
Toast
Display a toast message on the client side.
Can be used anywhere in a @page_router.ui("") or @app.ui("")
To persist the toast message, set auto_close to False
@app.ui("/some/path")
async def some_path():
ui.toast("This is a toast message").info()
Constructor
message: str=
svg: Literal= None
Methods
after_render(html: str) -> str
This method is called after the element is rendered.
:param html: The rendered HTML of the element.
before_render() -> Any
No documentation providedclasses(input: str) -> Toast
No documentation providederror() -> Toast
No documentation providedget_classes() -> str
Get html classes of the element.
:return: The classes of the element.
:type: str
info() -> Toast
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
set_auto_close(auto_close: bool) -> Toast
Set auto close
:param auto_close: True or False. Auto close False will keep the toast open until the user closes it
size(size: Literal) -> Self
Set the size of the element.
:param size: The size of the element.
:return: The current instance of the element.
success() -> Toast
No documentation providedsvg(svg: Literal) -> Toast
No documentation providedwarning() -> Toast
No documentation provided