# rememberDraggableState

Common/AllAndroid/JVM

## Functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/DraggableState` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/rememberDraggableState.composable#rememberDraggableState(kotlin.Function1)(onDelta: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Create and remember default implementation of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/DraggableState` interface that allows to pass a simple action that will be invoked when the drag occurs. | Cmn |

## Functions

### rememberDraggableState

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/gestures/Draggable.kt+function:rememberDraggableState) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)

```
@Composable
fun rememberDraggableState(onDelta: (Float) -> Unit): DraggableState
```

Create and remember default implementation of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/DraggableState` 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 `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/draggable.modifier#(androidx.compose.ui.Modifier).draggable(androidx.compose.foundation.gestures.DraggableState,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Boolean,kotlin.coroutines.SuspendFunction2,kotlin.coroutines.SuspendFunction2,kotlin.Boolean)` modifier. When constructing this `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/DraggableState`, you must provide a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/package-summary#rememberDraggableState(kotlin.Function1)` lambda, which will be invoked whenever drag happens (by gesture input or a custom `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/DraggableState#drag(androidx.compose.foundation.MutatePriority,kotlin.coroutines.SuspendFunction1)` call) with the delta in pixels.

| Parameters |
|---|---|
| `onDelta: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | callback invoked when drag occurs. The callback receives the delta in pixels. |