<div class='type'>Compose Modifier</div>

<a id='references'></a>


<h2 id="draganddropsource-transferdata">dragAndDropSource</h2>

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


```kotlin
fun Modifier.dragAndDropSource(transferData: (Offset) -> DragAndDropTransferData?): Modifier
```


A `Modifier` that allows an element it is applied to be treated like a source for drag and drop
operations. It displays the element dragged as a drag shadow.

Learn how to use `Modifier.dragAndDropSource`:

#### Parameters

| | |
| --- | --- |
| transferData | A function that receives the current offset of the drag operation and returns the `DragAndDropTransferData` to be transferred. If null is returned, the drag and drop transfer won't be started. |






<hr class="docs-overload-divider">


<h2 id="draganddropsource-drawdragdecoration-transferdata">dragAndDropSource</h2>

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


```kotlin
fun Modifier.dragAndDropSource(
    drawDragDecoration: DrawScope.() -> Unit,
    transferData: (Offset) -> DragAndDropTransferData?,
): Modifier
```


A `Modifier` that allows an element it is applied to be treated like a source for drag and drop
operations.

Learn how to use `Modifier.dragAndDropSource` while providing a custom drag shadow:

#### Parameters

| | |
| --- | --- |
| drawDragDecoration | provides the visual representation of the item dragged during the drag and drop gesture. |
| transferData | A function that receives the current offset of the drag operation and returns the `DragAndDropTransferData` to be transferred. If null is returned, the drag and drop transfer won't be started. |




<div class='sourceset sourceset-android'>Android</div>


> **Deprecated** Replaced by overload with a callback for obtain a transfer data,start detection is performed by Compose itself



<hr class="docs-overload-divider">


<h2 id="draganddropsource-block">dragAndDropSource</h2>

```kotlin
@ExperimentalFoundationApi
fun Modifier.dragAndDropSource(block: suspend DragAndDropSourceScope.() -> Unit): Modifier
```


A Modifier that allows an element it is applied to to be treated like a source for drag and drop
operations. It displays the element dragged as a drag shadow.

Learn how to use `Modifier.dragAndDropSource`:

#### Parameters

| | |
| --- | --- |
| block | A lambda with a `DragAndDropSourceScope` as a receiver which provides a `PointerInputScope` to detect the drag gesture, after which a drag and drop gesture can be started with `DragAndDropSourceScope.startTransfer`. |




<div class='sourceset sourceset-android'>Android</div>


> **Deprecated** Replaced by overload with a callback for obtain a transfer data,start detection is performed by Compose itself



<hr class="docs-overload-divider">


<h2 id="draganddropsource-drawdragdecoration-block">dragAndDropSource</h2>

```kotlin
@ExperimentalFoundationApi
fun Modifier.dragAndDropSource(
    drawDragDecoration: DrawScope.() -> Unit,
    block: suspend DragAndDropSourceScope.() -> Unit,
): Modifier
```


A Modifier that allows an element it is applied to to be treated like a source for drag and drop
operations.

Learn how to use `Modifier.dragAndDropSource` while providing a custom drag shadow:

#### Parameters

| | |
| --- | --- |
| drawDragDecoration | provides the visual representation of the item dragged during the drag and drop gesture. |
| block | A lambda with a `DragAndDropSourceScope` as a receiver which provides a `PointerInputScope` to detect the drag gesture, after which a drag and drop gesture can be started with `DragAndDropSourceScope.startTransfer`. |