VStack and HStack
Vertical and horizontal stack layouts with spacing and alignment.
VStack arranges children top-to-bottom; HStack arranges them
left-to-right. Both accept any number of viewable arguments (a View, a
Viewable, or nil to skip).
Spacing
Use the spacing tokens (SpaceXS, SpaceSM,
SpaceMD, SpaceLG, SpaceXL) for consistency.
Alignment
Align sets cross-axis alignment. In a VStack that is horizontal; in an
HStack it is vertical.
Legacy-friendly names (Leading, Trailing, Top, Bottom, Center)
alias the canonical AlignLeading, AlignTrailing, and so on. Either spelling
works.
Spacer
Spacer() expands to take up remaining space along the stack's primary axis.
Use it to push siblings apart:
Group
Group(children...) flattens its children into the parent layout. It is the
workaround for Go's limitation that you cannot mix args... spread with
additional positional arguments when calling a variadic function.
Growing a child
A child with .Grow() fills the remaining primary-axis space; siblings pack
at natural size. The TextField with a trailing Button is the canonical
use case:
In an HStack, any children declared before the grow child become leading,
and any children after become trailing. In a VStack they become top and
bottom. Only the first child with .Grow() participates; additional grow
marks on later siblings are ignored.