ui.drawer

Drawer

A drawer is a panel that slides in from the side of the screen. It can be used to display additional content or controls.

:type always_open: bool, optional

:type right: bool, optional

from uiwiz import ui

with ui.drawer() as drawer:
    with drawer.drawer_content():
        with ui.nav():
            drawer.drawer_button()

        with ui.col():
            ui.label("test1")
            ui.button("Click me")
            ui.label("test1")

    with drawer.drawer_side():
        with ui.element("li"):
            ui.link("Drawer-1", "/")

Constructor

always_open: bool= False
right: bool= False

Methods

after_render(html: str) -> str
This method is called after the element is rendered.
:param html: The rendered HTML of the element.
always_open(value: bool) -> NoneType
Set the drawer to always open until the screen size is too small.
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.
drawer_button() -> Element
No documentation provided
drawer_content() -> Element
No documentation provided
drawer_side() -> Element
No documentation provided
get_classes() -> str
Get html classes of the element.
:return: The classes of the element.
:type: str
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
right(value: bool) -> NoneType
Set the drawer to open from the right side of the screen.
size(size: Literal) -> Self
Set the size of the element.
:param size: The size of the element.
:return: The current instance of the element.
GitHub