---
title: "transformingMovable"
description: "Configures this subspace element to be interactive and movable, delegating the pose transformation to the system."
type: "function"
lastmod: "2026-05-20T01:13:53.079052Z"
---
## API Reference

### transformingMovable

> Source set: Android

```kotlin
public fun SubspaceModifier.transformingMovable(
    enabled: Boolean = true,
    scaleWithDistance: Boolean = true,
    onMove: ((SpatialMoveEvent) -> Unit)? = null,
): SubspaceModifier
```

Configures this subspace element to be interactive and movable, delegating the pose
transformation to the system.

When this modifier is present and enabled, draggable UI controls will be shown that allow the
user to move the element in 3D space. The system intercepts spatial input events, calculates the
resulting `Pose` and scale, and automatically applies these transformations to the element's
layout. This is the default behavior for standard movable UI elements where a 1:1 transformation
is desired, and custom gesture handling or manual state management is not required. Input events
used for moving in this way are consumed.

There are some limitations that should be considered when using this modifier: 1) the draggable
UI controls of nested composables using the [transformingMovable](/jetpack-compose/androidx.xr.compose/compose/functions/transformingMovable) modifier and [movable](/jetpack-compose/androidx.xr.compose/compose/functions/movable) modifier
may conflict with each other, 2) attaching multiple [transformingMovable](/jetpack-compose/androidx.xr.compose/compose/functions/transformingMovable) modifiers to the same
element will compound the movement distance, since each modifier independently applies the drag
offset upon release. 3) It should not be used with the following composables
[androidx.xr.compose.subspace.SpatialExternalSurfaceHemisphere](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialExternalSurfaceHemisphere) and
[androidx.xr.compose.subspace.SpatialExternalSurfaceSphere](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialExternalSurfaceSphere) due to their similarity with the
system environment and not having any layout size.

#### Parameters

| | |
| --- | --- |
| enabled | true if this composable should be movable. Setting this to false will remove the interactable affordance associated with the content. Disabling the modifier after movement keeps the composable at its last dragged position. Removing the modifier entirely resets the composable to its original layout position. |
| scaleWithDistance | true if this composable should scale in size when moved in depth. When enabled, the subspace element will grow if pushed away from the user or shrink when pulled toward the user in order to maintain the interact-ability and legibility of the panel. Scaling with distance respects other transformations applied to this layout. |
| onMove | Optional observer callback invoked during the manipulation. Since the system automatically applies the move, this callback is strictly for monitoring changes and should not control the position. The `onMove` callback values can be used to position other sibling composables with the offset modifier. This callback reports a [SpatialMoveEvent](/jetpack-compose/androidx.xr.compose/compose/classes/SpatialMoveEvent) which will contain a `Pose`. The `Pose` contained in this event is the sum of all previous events in the move gesture. |

## Code Examples
### BasicTransformingMovableSample
```kotlin
/** A sample demonstrating a simple movable component. */
@SubspaceComposable
@Composable
public fun BasicTransformingMovableSample() {
    SpatialPanel(modifier = SubspaceModifier.transformingMovable()) {
        Text("The user can move me around!")
    }
}
```
### TransformingMovableSiblingSample
```kotlin
/**
 * A sample demonstrating movement of sibling composables using the onMove callback from the
 * transformingMovable modifier
 */
@SubspaceComposable
@Composable
public fun TransformingMovableSiblingSample() {
    val density = LocalDensity.current
    var xOffset by remember { mutableStateOf(0.dp) }
    var yOffset by remember { mutableStateOf(0.dp) }
    var zOffset by remember { mutableStateOf(0.dp) }
    val customMovement: (SpatialMoveEvent) -> Unit = { moveEvent ->
        with(density) {
            xOffset = moveEvent.pose.translation.x.toDp()
            yOffset = moveEvent.pose.translation.y.toDp()
            zOffset = moveEvent.pose.translation.z.toDp()
        }
    }
    Subspace {
        SpatialPanel(modifier = SubspaceModifier.transformingMovable(onMove = customMovement)) {
            Text("The user can move me around")
        }
        SpatialPanel(modifier = SubspaceModifier.offset(x = xOffset, y = yOffset, z = zOffset)) {
            Text("Sibling Panel")
        }
    }
}
```
