Column
Column is a braced layout container whose main axis is vertical.
Arrange vertical content
Section titled “Arrange vertical content”Column { Text("Account", TextRole::Title), TextField(name).Label("Display name"), Button("Save").OnClick(SaveAccount),}.With( Padding(24.0F), Spacing(12.0F), CrossAlign(CrossAxisAlignment::Stretch))Spacing sets the gap between adjacent children.
MainAlign distributes remaining vertical space; CrossAlign positions or stretches children horizontally.
Children carrying Grow(factor) share available vertical space proportionally.
Preserve child order and identity
Section titled “Preserve child order and identity”The container accepts individual View values and flattened Views groups from ForEach.
Children retain declaration order for layout, painting, hit testing, and semantics.
- Construction:
Column { children... }or an explicitstd::vector<View>through its inheritedLayoutconstructor. - Layout modifiers:
Spacing,MainAlign,CrossAlign,Padding,Frame. - Child metadata:
Grow.
Use Row for horizontal placement and Flow when items should wrap.
Constraints and common mistakes
Section titled “Constraints and common mistakes”Column is declared in huxerui, <huxerui/view.h>. Its inherited constructors accept a child vector or braced View/Views content, including an empty collection. It has no component-specific events or style struct; child controls resolve their own themes.
MainAlign(Start/Center/End/SpaceBetween/SpaceAround/SpaceEvenly) positions children along the vertical axis; CrossAlign(Start/Center/End/Stretch) positions them horizontally. Extra space exists only when the parent gives the column more height than its content needs. Putting MainAlign(Center) on a content-height column will not center that column in the window.
Use a bounded-height parent and Grow() on a scrollable child to build a header/body/footer layout. A Column inside a vertical ScrollView measures its full content height; a Spacer there has no useful finite remaining height to fill. Use Spacing for uniform sibling gaps and Padding for the container’s inside edge.

