Skip to main content

FlowRow

Function FlowRow 

Source
pub fn FlowRow<F>(__arg0: Modifier, __arg1: FlowRowSpec, __arg2: F) -> NodeId
where F: FnMut() + 'static,
Expand description

Places children across a row and starts a new row when the available width is full. The spec sets the space between children and between rows.

ยงExample

use cranpose_ui::{
    widgets::{FlowRow, FlowRowSpec},
    *,
};

#[composable]
fn Topics() {
    FlowRow(
        Modifier::empty().fill_max_width(),
        FlowRowSpec::new()
            .main_axis_spacing(8.0)
            .cross_axis_spacing(4.0),
        || {
            for label in ["Rust", "Compose", "Android"] {
                Text(label, Modifier::empty().padding(8.0), TextStyle::default());
            }
        },
    );
}