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

A layout composable that places its children in horizontal sequence and wraps to the next line when it runs out of width (Jetpack Compose’s FlowRow).

§When to use

Use FlowRow for content whose item count or widths vary — chip groups, tag clouds, toolbars on narrow screens. For a single non-wrapping line, use Row.

§Arguments

  • modifier - Modifiers to apply to the flow layout.
  • spec - Spacing between items on a line and between lines.
  • content - The children composables to layout.

§Example

FlowRow(
    Modifier::fill_max_width(),
    FlowRowSpec::new().main_axis_spacing(8.0).cross_axis_spacing(4.0),
    || {
        for label in ["Rust", "Compose", "Android"] {
            Chip(label);
        }
    },
);