---
title: "movable"
description: "When the movable modifier is present and enabled, draggable UI controls will be shown that allow the user to move the element in 3D space."
type: "function"
lastmod: "2026-05-08T01:17:01.361357Z"
---
## API Reference

### movable

> Source set: Android

```kotlin
public fun SubspaceModifier.movable(
    enabled: Boolean = true,
    stickyPose: Boolean = false,
    scaleWithDistance: Boolean = true,
    onMoveStart: ((SpatialMoveEvent) -> Unit)? = null,
    onMoveEnd: ((SpatialMoveEvent) -> Unit)? = null,
    onMove: ((SpatialMoveEvent) -> Boolean)? = null,
): SubspaceModifier
```

When the movable modifier is present and enabled, draggable UI controls will be shown that allow
the user to move the element in 3D space.

There are some limitations that should be considered when using this modifier: 1) the draggable
UI controls of nested composables using the movable modifier may conflict with each other, 2)
when attaching multiple movable modifiers that handle movement internally, the movement effect
will be compounded.

#### Parameters

| | |
| --- | --- |
| enabled | true if this composable should be movable. |
| stickyPose | if enabled, the user specified position will be retained when the modifier is disabled or removed. |
| scaleWithDistance | true if this composable should scale in size when moved in depth. When this scaleWithDistance is enabled, the subspace element moved will grow or shrink. It will also maintain any explicit scale that it had before movement. |
| onMoveStart | a callback to process the start of a move event. This will only be called if [enabled](/jetpack-compose/androidx.compose.remote/remote-creation-compose/properties/enabled) is true. |
| onMoveEnd | a callback to process the end of a move event. This will only be called if [enabled](/jetpack-compose/androidx.compose.remote/remote-creation-compose/properties/enabled) is true. |
| onMove | a callback to process the pose change during movement, with translation in pixels. This will only be called if [enabled](/jetpack-compose/androidx.compose.remote/remote-creation-compose/properties/enabled) is true. If the callback returns false the default behavior of moving this composable's subspace hierarchy will be executed. If it returns true, it is the responsibility of the callback to process the event. |

## Code Examples
### BasicMovableSample
```kotlin
/** A sample demonstrating a simple movable component. */
@SubspaceComposable
@Composable
public fun BasicMovableSample() {
    SpatialPanel(modifier = SubspaceModifier.movable()) { Text("The user can move me around!") }
}
```
### CustomMovableSample
```kotlin
/** A sample demonstrating a custom movable component. */
@SubspaceComposable
@Composable
public fun CustomMovableSample() {
    var offsetX by remember { mutableStateOf(0.dp) }
    var offsetY by remember { mutableStateOf(0.dp) }
    var offsetZ by remember { mutableStateOf(0.dp) }
    var rotation by remember { mutableStateOf(Quaternion.Identity) }
    SpatialPanel(
        modifier =
            SubspaceModifier.movable {
                    offsetX = it.pose.translation.x.meters.toDp()
                    offsetY = it.pose.translation.y.meters.toDp()
                    offsetZ = it.pose.translation.z.meters.toDp()
                    rotation = it.pose.rotation
                    true // return true to prevent default behavior
                }
                .offset(x = offsetX, y = offsetY, z = offsetZ)
                .rotate(rotation)
    ) {
        Text("The user can move me around!")
    }
}
```
