# collectIsDraggedAsState

Common/All

## Functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html>` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/InteractionSource.https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/collectIsDraggedAsState.composable#(androidx.compose.foundation.interaction.InteractionSource).collectIsDraggedAsState()()` Subscribes to this `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource` and returns a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State` representing whether this component is dragged or not. | Cmn |

## Functions

### InteractionSource.collectIsDraggedAsState

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/interaction/DragInteraction.kt+function:collectIsDraggedAsState) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)

```
@Composable
fun InteractionSource.collectIsDraggedAsState(): State<Boolean>
```

Subscribes to this `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource` and returns a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State` representing whether this component is dragged or not.

`https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/DragInteraction` is typically set by interactions such as `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)` and `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/scrollable.modifier#(androidx.compose.ui.Modifier).scrollable(androidx.compose.foundation.gestures.ScrollableState,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.gestures.FlingBehavior,androidx.compose.foundation.interaction.MutableInteractionSource)`, and higher level components such as `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/LazyRow.composable#LazyRow(androidx.compose.ui.Modifier,androidx.compose.foundation.lazy.LazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Horizontal,androidx.compose.ui.Alignment.Vertical,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,kotlin.Function1)`, available through `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/LazyListState#interactionSource()`.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html>` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State` representing whether this component is being dragged or not |