<h2 id="rememberdraggable2dstate-ondelta">rememberDraggable2DState</h2>

<div class='sourceset sourceset-common'>Common</div>

```kotlin
@Composable
fun rememberDraggable2DState(onDelta: (Offset) -> Unit): Draggable2DState
```

Create and remember default implementation of [Draggable2DState](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/Draggable2DState) interface that allows to pass a
simple action that will be invoked when the drag occurs.

This is the simplest way to set up a [draggable2D](/jetpack-compose/androidx.compose.foundation/foundation/modifiers/draggable2D) modifier. When constructing this
[Draggable2DState](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/Draggable2DState), you must provide a `onDelta` lambda, which will be invoked whenever drag
happens (by gesture input or a custom [Draggable2DState.drag] call) with the delta in pixels.

#### Parameters

| | |
| --- | --- |
| onDelta | callback invoked when drag occurs. The callback receives the delta in pixels. |