<h2 id="spatialbox-modifier-alignment-propagateminconstraints">SpatialBox</h2>

<div class='sourceset sourceset-android'>Android</div>

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

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

A layout composable with `content`. The [SpatialBox](/jetpack-compose/androidx.xr.compose/compose/composable-functions/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](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialBox) according to the [alignment](/jetpack-compose/androidx.compose.ui/ui/interfaces/Alignment). For individually specifying the
alignments of the children layouts, use the [SpatialBoxScope.align](/jetpack-compose/androidx.xr.compose/compose/interfaces/SpatialBoxScope) modifier. By default, the
content will be measured without the [SpatialBox](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialBox)'s incoming min constraints. If
`propagateMinConstraints` is set to `true`, the min size set on the [SpatialBox](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialBox) will also be
applied to the content.

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

#### Parameters

| | |
| --- | --- |
| modifier | The modifier to be applied to the layout. |
| alignment | The default alignment of children within the [SpatialBox](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialBox). |
| propagateMinConstraints | Whether the incoming min constraints should be passed to content. |
| content | The content of the [SpatialBox](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialBox). |