Skip to main content

Column

Function Column 

Source
pub fn Column<State: 'static, M>(
    children: impl ViewSeq<State, M>,
) -> FlexView<State>
Expand description

A vertical flex (Axis::Vertical) of inflexible children — the common sugar. Use FlexView::new with flexible children when some should expand.

children is any ViewSeq: a Vec/array of views, a tuple of mixed view types ((a, b, c), positional, up to 12 and nestable), an Option (None drops the slot), or views(iter) for an iterator. Every element is erased once, here. A bare empty list needs its item type spelled out (Vec::<AnyView<State>>::new()).

use frust_widgets::{Column, FlexView, text};
// Same type: a `Vec`. Mixed types: a tuple, no `any(..)` needed.
let labels = Column(vec![text("a"), text("b"), text("c")]);
let mixed = Column((text("a"), Column((text("b"), text("c")))));