---
title: "SpatialRow"
description: "A layout composable that arranges its children in a horizontal sequence."
type: "composable"
lastmod: "2026-05-08T01:17:01.376361Z"
---
## API Reference

### SpatialRow

> Source set: Android

```kotlin
@Composable
@SubspaceComposable
public inline fun SpatialRow(
    modifier: SubspaceModifier = SubspaceModifier,
    verticalAlignment: SpatialAlignment.Vertical = SpatialAlignment.CenterVertically,
    depthAlignment: SpatialAlignment.Depth = SpatialAlignment.CenterDepthwise,
    horizontalArrangement: SpatialArrangement.Horizontal = SpatialArrangement.Center,
    crossinline content: @Composable @SubspaceComposable SpatialRowScope.() -> Unit,
)
```

A layout composable that arranges its children in a horizontal sequence. For arranging children
vertically, see [SpatialColumn](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialColumn).

#### Parameters

| | |
| --- | --- |
| modifier | Appearance modifiers to apply to this Composable. |
| verticalAlignment | The default vertical alignment for child elements within the row. |
| depthAlignment | The default depth alignment for child elements within the row. |
| horizontalArrangement | The horizontal arrangement of the children. |
| content | The composable content to be laid out horizontally in the row. |

## Code Examples
### SimpleSpatialRowSample
```kotlin
@Composable
public fun SimpleSpatialRowSample() {
    Subspace {
        SpatialRow(
            verticalAlignment = SpatialAlignment.CenterVertically,
            horizontalArrangement = SpatialArrangement.Center,
        ) {
            SpatialPanel(SubspaceModifier.weight(0.3f)) { Text("Left Panel") }
            SpatialPanel(modifier = SubspaceModifier.weight(0.3f)) { Text("Middle Panel") }
            SpatialPanel(modifier = SubspaceModifier.weight(0.3f)) { Text("Right Panel") }
        }
    }
}
```
