Card
A Card is a container for UI elements, offering a background and space to place components like buttons, inputs, and text within a CardContainer.
class Card
Do not create Card instances directly. Instead, use the create_card()
method of the CardContainer class to genereate them.
Nesting multiple Cards is prohibited.
Cards must be a direct children of the CardContainer.
Constructor
type
Allowed: "columns"
| "rows"
Default: columns
height
Allowed: "auto"
| "full"
Default: "full"
width
Allowed: "auto"
| "full"
Default: "full"
vertical_align
Allowed: "start"
| "center" | "end"
Default: "start"
Defines the alignment of the card's child elements (UI elements and Groups) along the vertical axis.
horizontal_align
Allowed: "start"
| "center" | "end"
Default: "start"
Defines the alignment of the card's child elements (UI elements and Groups) along the horizontal axis.
gap
See Gap
Default: 6
disallow_shrink
Allowed: True | False
Default: False
Prevents the card from shrinking when its width or height is set to auto
. Useful when cards adjust their size to fit other elements in the tab. Set to True
to disable shrinking. Leave it as default if no issues occur, as forcing this may cause unexpected layout behavior.
Methods
create_group(type, **kwargs)
Creates a Group instance within the card to organize and manage child elements as a single unit.
create_ui_element(element, **kwargs)
Creates a UI Element within the card.
Examples
Last updated