> Documentation index: https://developer.android.com/reference/llms.txt

# SpatialAlignment.Depth

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


```
interface SpatialAlignment.Depth
```

<br />

Known direct subclasses [SpatialBiasAlignment.Depth](https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialBiasAlignment.Depth.md.txt)

|---|---|
| `SpatialBiasAlignment.Depth` | Creates a weighted alignment that specifies a depth bias. |

*** ** * ** ***

An interface to calculate the alignment of a box of a certain size inside an available depth.

## Summary

| ### Public functions |
|---|---|
| `Int` | `align(size: Int, space: Int)` Provides the depth alignment offset from the origin of the space to the origin of the content. |

## Public functions

### align

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/xr-compose.md.txt#1.0.0-rc01)

```
fun align(size: Int, space: Int): Int
```

Provides the depth alignment offset from the origin of the space to the origin of the content.

| Parameters |
|---|---|
| `size: Int` | The content size in pixels. |
| `space: Int` | The available space in pixels. |