---
title: "DragAndDropTarget"
description: "Provides a means of receiving a transfer data from a drag and drop session."
type: "interface"
---

<div class='type'>Interface</div>


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

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



```kotlin
interface DragAndDropTarget
```


Provides a means of receiving a transfer data from a drag and drop session.


## Functions

```kotlin
fun onDrop(event: DragAndDropEvent): Boolean
```


An item has been dropped inside this `DragAndDropTarget`.

#### Returns

| | |
| --- | --- |
|  | true to indicate that the `DragAndDropEvent` was consumed; false indicates it was rejected. |



```kotlin
fun onStarted(event: DragAndDropEvent) = Unit
```


A drag and drop session has just been started and this `DragAndDropTarget` is eligible to
receive it. This gives an opportunity to set the state for a `DragAndDropTarget` in
preparation for consuming a drag and drop session.


```kotlin
fun onEntered(event: DragAndDropEvent) = Unit
```


An item being dropped has entered into the bounds of this `DragAndDropTarget`.


```kotlin
fun onMoved(event: DragAndDropEvent) = Unit
```


An item being dropped has moved within the bounds of this `DragAndDropTarget`.


```kotlin
fun onExited(event: DragAndDropEvent) = Unit
```


An item being dropped has moved outside the bounds of this `DragAndDropTarget`.


```kotlin
fun onChanged(event: DragAndDropEvent) = Unit
```


An event in the current drag and drop session has changed within this `DragAndDropTarget`
bounds. Perhaps a modifier key has been pressed or released.


```kotlin
fun onEnded(event: DragAndDropEvent) = Unit
```


The drag and drop session has been completed. All `DragAndDropTarget` instances in the
hierarchy that previously received an `onStarted` event will receive this event. This gives
an opportunity to reset the state for a `DragAndDropTarget`.



