Skip to main content

Row

Function Row 

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

A horizontal flex (Axis::Horizontal) 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::{FlexView, Row, text};
// Same type: a `Vec`. Mixed types: a tuple, no `any(..)` needed.
let labels = Row(vec![text("a"), text("b"), text("c")]);
let mixed = Row((text("a"), Row((text("b"), text("c")))));