Represents a configuration for a FlexBox container.

FlexBoxConfig is implemented as a functional interface where the lambda is executed on FlexBoxConfigScope during the layout phase. This means that reading state inside the lambda will only trigger relayout, not recomposition.

Note: Configuration properties are not additive. If a property is assigned multiple times within the configuration block, the last assignment overrides previous values.

Reusable Config

For better performance, define configs as top-level constants:

private val RowWrap = FlexBoxConfig {
direction = FlexDirection.Row
wrap = FlexWrap.Wrap
gap = 8.dp
}

Summary

Nested types

Public companion functions

open Unit

Default Config: Row direction, NoWrap, Start alignment.

Cmn

Public functions

Unit

Configures the FlexBox container properties.

Cmn

Public companion functions

open fun FlexBoxConfigScope.configure(): Unit

Default Config: Row direction, NoWrap, Start alignment.

Public functions

fun FlexBoxConfigScope.configure(): Unit

Configures the FlexBox container properties. Called during the layout phase, not during composition.