<h2 id="gravityaligned">gravityAligned</h2>

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

```kotlin
public fun SubspaceModifier.gravityAligned(): SubspaceModifier
```

A [SubspaceModifier](/jetpack-compose/androidx.xr.compose/compose/interfaces/SubspaceModifier) that forces the content to remain upright, aligned with gravity by isolating
the element's yaw by cancelling parent pitch and roll.

This modifier calculates the necessary counter-rotation to ignore the pitch and roll of its
parent entity's total world transformation. It only affects the rotation and not the translation.
This is useful for UI elements like labels or billboards that should always stay level,
regardless of the orientation of the object they are attached to. It effectively isolates the
**yaw** (rotation around the vertical Y-axis).