NUI / Components / Layout
HorizontalBox
HorizontalBox arranges children horizontally.
Supported as a horizontal stack layout.
Overview
HorizontalBox arranges children horizontally.
When to use
- Use HorizontalBox when matching Unreal-style layout naming is preferred over Row.
Children
Supports normal children.
children {
Text ChildText {
text: "THIS IS THE CHILD COMPONENT"
}
}Basic syntax
HorizontalBox HeaderActions {
gap: 8
children {
Text ChildText {
text: "THIS IS THE CHILD COMPONENT"
}
}
}Supported properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
gap | number | No | 0 | Space between children. |
width | number | No | Auto | Desired width. |
height | number | No | Auto | Desired height. |
padding | margin | No | margin(0) | Inner padding. |
childPadding | margin | No | margin(0) | Padding around children. |
horizontalAlign | enum | No | Inherited | Component horizontal alignment. |
verticalAlign | enum | No | Inherited | Component vertical alignment. |
contentHorizontalAlign | enum | No | Inherited | Child horizontal alignment. |
contentVerticalAlign | enum | No | Inherited | Child vertical alignment. |
opacity | number | No | 1 | Render opacity. |
layer | integer | No | Context default | Layer order inside layered parents. |
visible | bool | No | true | Visibility flag. |
Contextual properties
Contextual property rules
HorizontalBox may receive stack, canvas, grid, wrap, or ExpandableArea slot properties only when it is authored as a direct child of the matching parent. Children of HorizontalBox may use fill or auto. See section 7.
Full syntax example
HorizontalBox HeaderActions {
gap: 8
width: 420
height: 48
padding: margin(8)
childPadding: margin(2)
horizontalAlign: fill
verticalAlign: center
contentHorizontalAlign: left
contentVerticalAlign: center
opacity: 1
layer: 1
visible: true
children {
Text ChildText {
text: "THIS IS THE CHILD COMPONENT"
}
}
}Limitations
- Row is the shorter public-facing name for the same common layout intent.