SpatialCurvedRow

Functions summary

inline Unit
@Composable
@SubspaceComposable
SpatialCurvedRow(
    modifier: SubspaceModifier,
    verticalAlignment: SpatialAlignment.Vertical,
    depthAlignment: SpatialAlignment.Depth,
    horizontalArrangement: SpatialArrangement.Horizontal,
    curveRadius: Dp,
    crossinline content: @Composable @SubspaceComposable SpatialRowScope.() -> Unit
)

A layout composable that arranges its children in a curved horizontal sequence.

Functions

SpatialCurvedRow

@Composable
@SubspaceComposable
inline fun SpatialCurvedRow(
    modifier: SubspaceModifier = SubspaceModifier,
    verticalAlignment: SpatialAlignment.Vertical = SpatialAlignment.CenterVertically,
    depthAlignment: SpatialAlignment.Depth = SpatialAlignment.CenterDepthwise,
    horizontalArrangement: SpatialArrangement.Horizontal = SpatialArrangement.Center,
    curveRadius: Dp = SpatialCurvedRowDefaults.curveRadius,
    crossinline content: @Composable @SubspaceComposable SpatialRowScope.() -> Unit
): Unit

A layout composable that arranges its children in a curved horizontal sequence.

import androidx.compose.material3.Text
import androidx.compose.ui.unit.dp
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialCurvedRow
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.layout.SpatialAlignment
import androidx.xr.compose.subspace.layout.SpatialArrangement
import androidx.xr.compose.subspace.layout.SubspaceModifier

Subspace {
    SpatialCurvedRow(
        curveRadius = 300.dp,
        verticalAlignment = SpatialAlignment.CenterVertically,
        horizontalArrangement = SpatialArrangement.Center,
    ) {
        SpatialPanel(SubspaceModifier.weight(0.3f)) { Text("Left Panel") }
        SpatialPanel(SubspaceModifier.weight(0.3f)) { Text("Center Panel") }
        SpatialPanel(SubspaceModifier.weight(0.3f)) { Text("Right Panel") }
    }
}
Parameters
modifier: SubspaceModifier = SubspaceModifier

Appearance modifiers to apply to this Composable.

verticalAlignment: SpatialAlignment.Vertical = SpatialAlignment.CenterVertically

The default vertical alignment for child elements within the row.

depthAlignment: SpatialAlignment.Depth = SpatialAlignment.CenterDepthwise

The default depth alignment for child elements within the row.

horizontalArrangement: SpatialArrangement.Horizontal = SpatialArrangement.Center

The horizontal arrangement of the children.

curveRadius: Dp = SpatialCurvedRowDefaults.curveRadius

Defines the curve of the row by specifying its radius in Dp. A larger radius creates a gentler curve (less curvature), while a smaller positive radius results in a sharper curve (more curvature). Using Dp.Infinity or a non-positive value (zero or negative) makes the row straight. When curved, row items are angled to follow the curve's path. This value is the radial distance in the polar coordinate system.

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

The composable content to be laid out horizontally in the row.