---
title: "resizable"
description: "When the resizable modifier is present and enabled, draggable UI controls will be shown that allow the user to resize the element in 3D space."
type: "function"
lastmod: "2026-06-18T10:32:52.906862Z"
---
## API Reference

### resizable

> Source set: Android

```kotlin
public fun SubspaceModifier.resizable(
    minimumSize: DpVolumeSize = DpVolumeSize.Zero,
    maximumSize: DpVolumeSize = DpVolumeSize(Dp.Infinity, Dp.Infinity, Dp.Infinity),
    maintainAspectRatio: Boolean = false,
    onResize: (SpatialResizeEvent) -> Unit,
): SubspaceModifier
```

When the resizable modifier is present and enabled, draggable UI controls will be shown that
allow the user to resize the element in 3D space. The final size is not automatically applied to
the Composable. The developer must use the `onResize` event and apply the result themselves.
(e.g., by updating a state backed by [SubspaceModifier.width](/jetpack-compose/androidx.xr.compose/compose/functions/width) and [SubspaceModifier.height](/jetpack-compose/androidx.xr.compose/compose/functions/height)) The
resize affordance will not curve and thus adding it to a Composable with curvature like
[SpatialCurvedRow](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialCurvedRow) is not recommended.

#### Parameters

| | |
| --- | --- |
| minimumSize | The minimum allowable size for the object, represented by a [DpVolumeSize](/jetpack-compose/androidx.xr.compose/compose/classes/DpVolumeSize). The object cannot be scaled down beyond these dimensions. Defaults to `DpVolumeSize.Zero`. |
| maximumSize | The maximum allowable size for the object, represented by a [DpVolumeSize](/jetpack-compose/androidx.xr.compose/compose/classes/DpVolumeSize). The object cannot be scaled up beyond these dimensions. Defaults to a [DpVolumeSize](/jetpack-compose/androidx.xr.compose/compose/classes/DpVolumeSize) with all dimensions set to `Dp.Infinity`, meaning no upper limit by default. |
| maintainAspectRatio | If `true`, the object's aspect ratio (proportions) will be preserved during resizing. If `false`, individual dimensions can be changed independently. |
| onResize | Mandatory callback invoked continuously during the interaction that receives a [SpatialResizeEvent](/jetpack-compose/androidx.xr.compose/compose/classes/SpatialResizeEvent) containing the calculated target size. The size contained in this event is the resulting size after the resize gesture and should be used to manually resize the corresponding layout. |

### resizable

> **Deprecated** Use transformingResizable() for default system-handled resizing that automatically applies transformations to the layout. For custom resizing where you manually apply the resulting size (e.g., via width/height), use the updated resizable() modifier signature.

> Source set: Android

```kotlin
public fun SubspaceModifier.resizable(
    enabled: Boolean = true,
    minimumSize: DpVolumeSize = DpVolumeSize.Zero,
    maximumSize: DpVolumeSize = DpVolumeSize(Dp.Infinity, Dp.Infinity, Dp.Infinity),
    maintainAspectRatio: Boolean = false,
    onResizeStart: ((IntVolumeSize) -> Unit) = {},
    onResizeUpdate: ((IntVolumeSize) -> Unit) = {},
    onResizeEnd: ((IntVolumeSize) -> Boolean) = { false },
): SubspaceModifier
```

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

#### Parameters

| | |
| --- | --- |
| enabled | Whether resizing is enabled for this object. If `false`, the object cannot be resized. When resizing behavior is handled by the API, changing the [enabled](/jetpack-compose/androidx.compose.remote/remote-creation-compose/properties/enabled) state of the modifier does not clear the user resize state; whereas, removing the modifier will reset the user resize state, causing the object to revert to its layout size. Defaults to `true`. |
| minimumSize | The minimum allowable size for the object, represented by a [DpVolumeSize](/jetpack-compose/androidx.xr.compose/compose/classes/DpVolumeSize). The object cannot be scaled down beyond these dimensions. Defaults to `DpVolumeSize.Zero`. |
| maximumSize | The maximum allowable size for the object, represented by a [DpVolumeSize](/jetpack-compose/androidx.xr.compose/compose/classes/DpVolumeSize). The object cannot be scaled up beyond these dimensions. Defaults to a [DpVolumeSize](/jetpack-compose/androidx.xr.compose/compose/classes/DpVolumeSize) with all dimensions set to `Dp.Infinity`, meaning no upper limit by default. |
| maintainAspectRatio | If `true`, the object's aspect ratio (proportions) will be preserved during resizing. If `false`, individual dimensions can be changed independently. Defaults to `false`. |
| onResizeStart | A callback to be called when the resize event starts. |
| onResizeUpdate | A callback to be called when the size changes during a resize event. |
| onResizeEnd | A callback to be called when the object's size changes, after a resize event has ended. It receives an [IntVolumeSize](/jetpack-compose/androidx.xr.compose/compose/classes/IntVolumeSize) representing the new size. Returning `true` from this callback indicates that the developer intends to handle the size change, and the API should not resize the object. Returning `false` indicates that the developer will not handle the size change, and the API should proceed with changing the size of the object itself. By default, if `onResizeEnd` is not provided, the API will change the size of the object. |

## Code Examples
### ResizableWithStateSample
```kotlin
/**
 * A sample demonstrating a resizable component where the developer manages the state and applies
 * the resulting size.
 */
@SubspaceComposable
@Composable
public fun ResizableWithStateSample() {
    val density = LocalDensity.current
    var panelWidth by remember { mutableStateOf(400.dp) }
    var panelHeight by remember { mutableStateOf(300.dp) }
    SpatialPanel(
        modifier =
            SubspaceModifier.width(panelWidth)
                .height(panelHeight)
                .resizable(
                    onResize = { event ->
                        // The developer decides when and how to apply the new size.
                        // In this example, we update our state when the resize interaction ends.
                        if (event.type == SpatialResizeEventType.End) {
                            with(density) {
                                panelWidth = event.size.width.toDp()
                                panelHeight = event.size.height.toDp()
                            }
                        }
                    }
                )
    ) {
        Text("Resizable with size state.")
    }
}
```
