HorizontalLayout
export component Foo inherits Window { width: 200px; height: 100px; HorizontalLayout { spacing: 5px; Rectangle { background: red; width: 10px; } Rectangle { background: blue; min-width: 10px; } Rectangle { background: yellow; horizontal-stretch: 1; } Rectangle { background: green; horizontal-stretch: 2; } }}Places its children next to each other horizontally.
The size of elements can either be fixed with the width or height property, or if they aren’t set
they will be computed by the layout respecting the minimum and maximum sizes and the stretch factor.
Spacing Properties
Section titled “Spacing Properties”spacing
Section titled “spacing” length default: 0px
The distance between the elements in the layout.
Padding Properties
Section titled “Padding Properties”padding
Section titled “padding” length default: 0px
The padding within the layout as a whole. This single value is applied to all sides.
To target specific sides with different values use the following properties:
padding-left
Section titled “padding-left” length default: 0px
padding-right
Section titled “padding-right” length default: 0px
padding-top
Section titled “padding-top” length default: 0px
padding-bottom
Section titled “padding-bottom” length default: 0px
Alignment Properties
Section titled “Alignment Properties”alignment
Section titled “alignment” enum LayoutAlignment default: the first enum value
Set the alignment along the main (horizontal) axis. Matches the CSS flex box.
align-items
Section titled “align-items” enum LayoutAlignItems default: the first enum value
Set the alignment of items along the cross (vertical) axis.
The default is stretch, meaning each item fills the full height of the layout.
The other values (start, end, center) size each
item to its preferred height, clamped to its min/max, and position it at the
top, bottom, or center of the layout’s content box.
export component Example inherits Window { width: 200px; height: 100px; HorizontalLayout { align-items: center; Rectangle { background: red; preferred-width: 30px; preferred-height: 20px; } Rectangle { background: blue; preferred-width: 30px; preferred-height: 40px; } Rectangle { background: green; preferred-width: 30px; preferred-height: 60px; } }}© 2026 SixtyFPS GmbH