Layout
Learn how the layout attributes work.
width & height
min_width & min_height
max_width & max_height
Size units
direction
padding
margin
display
⚠️ Freya's layout is still somewhat limited.
width & height
All elements support both width
and height
attributes.
See syntax for Size Units
.
Usage
min_width & min_height
rect
supports specifying a minimum width and height, this can be useful if you use it alongside a percentage for the target size.
See syntax for Size Units
.
Usage
max_width & max_height
rect
supports specifying a maximum width and height.
See syntax for Size Units
.
Usage
Size Units
Auto
Will use it's inner children as size, so in this case, the rect
width will be equivalent to the width of label
:
Logical pixels
Percentages
Relative percentage to the parent equivalent value.
calc()
For more complex logic you can use the calc()
function.
direction
Control how the inner elements will be stacked, possible values are horizontal
, vertical
(default) or both
(default for text elements, e.g label, paragraph, text, etc).
Usage
padding
Specify the inner paddings of an element. You can do so by three different ways.
display
Control how the inner elements are displayed, possible values are normal
(default) or center
.
margin
Specify the margin of an element. You can do so by three different ways.