Skip to main content

Column

Column is the main vertical layout primitive in Fission.

It places children top to bottom, with optional gap, flex behavior, wrapping, and accessibility semantics. If you are building screens, forms, cards, settings pages, or content stacks, you will use Column constantly.

Use Column when order flows vertically and children belong in the normal layout stream. Do not use it for layered overlays, absolute positioning, or huge virtualized lists; those are better handled by ZStack, Positioned, or LazyColumn.

Example

use fission::core::ui::{Column, Text};
use fission_ir::op::AlignItems;

let node = Column {
gap: Some(12.0),
align_items: AlignItems::Stretch,
children: vec![
Text::new("Profile").into_node(),
Text::new("Email settings").into_node(),
Text::new("Security").into_node(),
],
..Default::default()
}
.into_node();

Field table

FieldTypeMeaningNotes / default behavior
idOption<NodeId>Stable node identity.Defaults to None.
childrenVec<Node>Child nodes laid out from top to bottom.Defaults to an empty list.
semanticsOption<Semantics>Optional accessibility semantics wrapper.When present, the lowered column is wrapped in a semantics node.
flex_growf32How much extra space the column absorbs from its parent.Defaults to 0.0.
flex_shrinkf32How much the column is allowed to shrink when space is tight.Defaults to 1.0.
gapOption<f32>Vertical spacing between children.Defaults to None.
wrapFlexWrapWhether children wrap when they overflow.Defaults to FlexWrap::NoWrap. Most columns do not wrap.
align_itemsAlignItemsCross-axis alignment, which is horizontal in a column.Defaults to AlignItems::Stretch.
justify_contentJustifyContentMain-axis distribution, which is vertical in a column.Defaults to JustifyContent::Start.

Layout behavior

Column lowers to a vertical flex layout. That means justify_content controls vertical distribution and align_items controls horizontal placement of each child. Beginners often mix those up because the meaning changes with the layout direction.

Column is also a good root for responsive screen sections because it makes spacing and reading order explicit. When a screen becomes scrollable, the common pattern is a Scroll containing a Column.

Specific advice

Prefer gap over sprinkling fixed Spacer nodes between every child. A spacer is still useful when one child should absorb leftover space, but gap usually reads better for ordinary stacked content.

If you only need a simpler convenience wrapper with children and spacing, use VStack.

Row, VStack, Scroll, and Wrap.