Interface

FlexConfig

Represents a configuration for a flex item within a FlexBox.

FlexConfigSample

@Sampled
@Composable
fun FlexConfigSample() {
    // Define reusable FlexConfig - can be a top-level constant
    val FlexibleCentered = FlexConfig {
        grow(1f)
        shrink(0f)
        basis(100.dp)
        alignSelf(FlexAlignSelf.Center)
    }

    FlexBox(modifier = Modifier.fillMaxWidth().height(100.dp)) {
        Box(Modifier.background(Color.Blue).flex(FlexibleCentered))
    }
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: