<h2 id="constraindepth-depth">constrainDepth</h2>

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

```kotlin
public fun VolumeConstraints.constrainDepth(depth: Int): Int
```

Constrains a given depth value to fit within the bounds of this [VolumeConstraints](/jetpack-compose/androidx.xr.compose/compose/classes/VolumeConstraints) object.

#### Parameters

| | |
| --- | --- |
| depth | the depth value to constrain. |

#### Returns

| | |
| --- | --- |
|  | the constrained depth value, ensuring it's within the minimum and maximum depth bounds. |