SpatialBox

Functions summary

inline Unit
@Composable
@SubspaceComposable
SpatialBox(
    modifier: SubspaceModifier,
    alignment: SpatialAlignment,
    propagateMinConstraints: Boolean,
    crossinline content: @Composable @SubspaceComposable SpatialBoxScope.() -> Unit
)

A layout composable that sizes itself to fit its content, subject to incoming constraints.

Functions

@Composable
@SubspaceComposable
inline fun SpatialBox(
    modifier: SubspaceModifier = SubspaceModifier,
    alignment: SpatialAlignment = SpatialAlignment.Center,
    propagateMinConstraints: Boolean = false,
    crossinline content: @Composable @SubspaceComposable SpatialBoxScope.() -> Unit
): Unit

A layout composable that sizes itself to fit its content, subject to incoming constraints.

A layout composable with content. The SpatialBox will size itself to fit the content, subject to the incoming constraints. When children are smaller than the parent, by default they will be positioned inside the SpatialBox according to the alignment. For individually specifying the alignments of the children layouts, use the SpatialBoxScope.align modifier. By default, the content will be measured without the SpatialBox's incoming min constraints. If propagateMinConstraints is set to true, the min size set on the SpatialBox will also be applied to the content.

Note: If the content has multiple children, they might overlap depending on their positioning.

Parameters
modifier: SubspaceModifier = SubspaceModifier

The modifier to be applied to the layout.

alignment: SpatialAlignment = SpatialAlignment.Center

The default alignment of children within the SpatialBox.

propagateMinConstraints: Boolean = false

Whether the incoming min constraints should be passed to content.

crossinline content: @Composable @SubspaceComposable SpatialBoxScope.() -> Unit

The content of the SpatialBox.