# AnchoredDragScope

# AnchoredDragScope

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/AnchoredDraggable.kt+class:androidx.compose.foundation.gestures.AnchoredDragScope)  
Added in[1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.6.0)
Common/AllAndroid/JVM
  - Cmn  

  ```
  interface AnchoredDragScope
  ```

*** ** * ** ***

Scope used for suspending anchored drag blocks. Allows to set[AnchoredDraggableState.offset](https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/AnchoredDraggableState#offset())to a new value.  

|                                                                                                        See also                                                                                                        |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| [anchoredDrag](https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/AnchoredDraggableState#anchoredDrag(androidx.compose.foundation.MutatePriority,kotlin.coroutines.SuspendFunction2)) | to learn how to start the anchored drag and get the access to this scope. |

## Summary

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [dragTo](https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/AnchoredDragScope#dragTo(kotlin.Float,kotlin.Float))`(newOffset: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, lastKnownVelocity: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Assign a new value for an offset value for[AnchoredDraggableState](https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/AnchoredDraggableState). | Cmn |

## Public functions

### dragTo

Cmn  
Added in[1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.6.0)  

```
fun dragTo(newOffset: Float, lastKnownVelocity: Float = 0.0f): Unit
```

Assign a new value for an offset value for[AnchoredDraggableState](https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/AnchoredDraggableState).  

|                                                  Parameters                                                   |
|---------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `newOffset: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)                  | new value for[AnchoredDraggableState.offset](https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/AnchoredDraggableState#offset()). |
| `lastKnownVelocity: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` = 0.0f` | last known velocity (if known)                                                                                                                                     |