Skip to main content

VStack

VStack is the convenience version of Column.

It is useful when the defaults of Column already match the layout you want and all you need is a short way to provide children and spacing.

Use VStack for simple grouped sections. Do not use it when you need richer Column features such as custom alignment, wrapping, flex tuning, or semantics.

Example

use fission::core::ui::Text;
use fission::prelude::*;

let node = VStack {
spacing: Some(12.0),
children: vec![
Text::new("Title").into_node(),
Text::new("Body copy").into_node(),
],
}
.into_node();

Field table

FieldTypeMeaningNotes / default behavior
childrenVec<Node>Child nodes laid out vertically.Defaults to an empty list.
spacingOption<f32>Gap between children.Defaults to None. Maps to Column.gap.

Behavior and advice

VStack simply builds a Column with the provided children and spacing. It is intentionally small. That is its strength.

If you need to change the cross-axis alignment, justify content, wrapping behavior, or semantics, switch to Column rather than trying to stretch the meaning of VStack.

Column, HStack, and Scroll.