by @alexstyl
✉️ Leave your feedback

← Back to Foundation Layout

BoxWithConstraints

Component
in
Foundation Layout
. Since 1.0.0

Overview

Examples

Community Notes

A composable that defines its own content according to the available space, based on the incoming constraints or the current LayoutDirection.

Overloads

BoxWithConstraints

@Composable
@UiComposable
fun BoxWithConstraints(
    modifier: Modifier = Modifier,
    contentAlignment: Alignment = Alignment.TopStart,
    propagateMinConstraints: Boolean = false,
    content:
        @Composable @UiComposable BoxWithConstraintsScope.() -> Unit
)

Parameters

NameDescription
modifierModifier to be applied to the layout.
contentAlignmentThe default alignment inside the BoxWithConstraints.
propagateMinConstraintsWhether the incoming min constraints should be passed to content.
contentThe content of the BoxWithConstraints
Previous ComponentBox
Next ComponentColumn