ui.label
Label
This element is used for labels that can be bound to form elements.
:type text: str, optional
:type for_: Element, optional
Constructor
text: Optional= None
for_: Optional= 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
This method is called before the element is rendered.
bind_text_from(element: Element, trigger: Union, swap: Optional) -> Any
Bind the text of this element to data of another element.
Requires the other element to have a name attribute.
:param element: Element to bind to
:param trigger: Event trigger to bind to
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.
combined_label(text: str, for_: Element) -> Label
Create a label with text and bind it to an element (label first).
combined_label_end(text: str, for_: Element) -> Label
Create a label with text and bind it to an element (element first).
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
set_for(for_: Element) -> Label
No documentation providedset_text(text: str) -> Label
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.