Group
class Group
A Group
is a UI element that can only exist as a child of a Card. It is used to organize multiple UI Elements into a single unit for easier alignment and positioning.
Do not create Group instances directly. Instead, use the create_group()
method of the Card class to genereate them.
Nesting multiple Groups is allowed.
Constructor
type
Allowed: "columns"
| "rows"
Default: columns
vertical_align
Allowed: "start"
| "center" | "end"
Default: "start"
Defines the alignment of the group's child elements (UI elements and Groups) along the vertical axis.
horizontal_align
Allowed: "start"
| "center" | "end"
Default: "start"
Defines the alignment of the group's child elements (UI elements and Groups) along the horizontal axis.
gap
full_width
Allowed: True | False
Default: False
Forces the group to occupy the entire available width. Use this if the group appears smaller than expected. Note: It may require setting the parent elements (such as containers and cards) to full width as well.
Methods
create_group(type, **kwargs)
Creates a nested Group instance within the current Group.
create_ui_element(element, **kwargs)
Examples
Improved version of the last example from the previous section (Card). Here, Group is used to place the button next to the input.
Last updated