Composable Function

rememberDraggableState

Create and remember default implementation of DraggableState interface that allows to pass a simple action that will be invoked when the drag occurs.

rememberDraggableState

Source set: Common
@Composable
public fun rememberDraggableState(onDelta: (Float) -> Unit): DraggableState

Create and remember default implementation of 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 draggable modifier. When constructing this DraggableState, you must provide a onDelta lambda, which will be invoked whenever drag happens (by gesture input or a custom DraggableState.drag call) with the delta in pixels.

Parameters

onDelta callback invoked when drag occurs. The callback receives the delta in pixels.
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: