# SpatialArrangement.Horizontal

Artifact: [androidx.xr.compose:compose](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/subspace/layout/SpatialArrangement.kt+class:androidx.xr.compose.subspace.layout.SpatialArrangement.Horizontal) Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)


```
interface SpatialArrangement.Horizontal
```

<br />

Known direct subclasses [SpatialArrangement.AxisIndependent](https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialArrangement.AxisIndependent)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialArrangement.AxisIndependent` | Used to specify the horizontal arrangement of the layout's children in horizontal layouts like `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/SpatialRow.composable#SpatialRow(androidx.xr.compose.subspace.layout.SubspaceModifier,androidx.xr.compose.subspace.layout.SpatialAlignment.Vertical,androidx.xr.compose.subspace.layout.SpatialAlignment.Depth,androidx.xr.compose.subspace.layout.SpatialArrangement.Horizontal,kotlin.Function1)`, or the vertical arrangement of the layout's children in vertical layouts like `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/SpatialColumn.composable#SpatialColumn(androidx.xr.compose.subspace.layout.SubspaceModifier,androidx.xr.compose.subspace.layout.SpatialAlignment.Horizontal,androidx.xr.compose.subspace.layout.SpatialAlignment.Depth,androidx.xr.compose.subspace.layout.SpatialArrangement.Vertical,kotlin.Function1)`. |

*** ** * ** ***

Used to specify the horizontal arrangement of the layout's children in layouts like `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/SpatialRow.composable#SpatialRow(androidx.xr.compose.subspace.layout.SubspaceModifier,androidx.xr.compose.subspace.layout.SpatialAlignment.Vertical,androidx.xr.compose.subspace.layout.SpatialAlignment.Depth,androidx.xr.compose.subspace.layout.SpatialArrangement.Horizontal,kotlin.Function1)`.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density.https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialArrangement.Horizontal#(androidx.compose.ui.unit.Density).arrange(kotlin.Int,kotlin.IntArray,androidx.compose.ui.unit.LayoutDirection,kotlin.IntArray)( totalSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, sizes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html, layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection, outPositions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html )` Horizontally places the layout children. |

| ### Public properties |
|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialArrangement.Horizontal#spacing()` Spacing that should be added between any two adjacent layout children. |

## Public functions

### Density.arrange

Artifact: [androidx.xr.compose:compose](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/subspace/layout/SpatialArrangement.kt+function:arrange) Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
fun Density.arrange(
    totalSize: Int,
    sizes: IntArray,
    layoutDirection: LayoutDirection,
    outPositions: IntArray
): Unit
```

Horizontally places the layout children.

| Parameters |
|---|---|
| `totalSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Available space that can be occupied by the children, in pixels. |
| `sizes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html` | An array of sizes of all children, in pixels. |
| `layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection` | A layout direction, left-to-right or right-to-left, of the parent layout that should be taken into account when determining positions of the children. |
| `outPositions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html` | An array of the size of `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialArrangement.Horizontal#(androidx.compose.ui.unit.Density).arrange(kotlin.Int,kotlin.IntArray,androidx.compose.ui.unit.LayoutDirection,kotlin.IntArray)` that returns the calculated positions. Position of each child is from the left edge of the parent to center of the child, in pixels. |

## Public properties

### spacing

```
open val spacing: Dp
```

Spacing that should be added between any two adjacent layout children.