DropArea
Use DropArea to accept drops coming from a DragArea, or from another application on platforms that support it.
The can-drop callback runs while the cursor moves over the area to decide whether to accept the drag,
and which action (copy/move/link) to perform.
The dropped callback runs when the user releases the mouse inside the area after can-drop returned
a non-none action.
See DragAndDrop for a usage guide and a complete example.
Properties
Section titled “Properties”enabled
Section titled “enabled” bool default: true
Set to false to stop the DropArea from accepting any drops.
Callbacks
Section titled “Callbacks”can-drop(event: DropEvent) -> DragAction
Section titled “can-drop(event: DropEvent) -> DragAction”Return the action this target wants to perform with the drag, or DragAction.none to reject.
The runtime clamps the returned value to the source’s allowed set: anything the source did not
allow is treated as none.
The argument is a DropEvent describing the drag.
dropped(event: DropEvent) -> DragAction
Section titled “dropped(event: DropEvent) -> DragAction”Invoked when the user releases the mouse over the area after can-drop returned a non-none
action. Use this callback to read event.data and apply the drop. The returned
DragAction is reported to the source via drag-finished; return event.proposed-action
to mirror what was negotiated during hover, or a different action to refine the choice at
drop time. The runtime clamps the return value against the source’s allowed set.
contains-drag
Section titled “contains-drag” bool (out) default: false
true while an accepted drag hovers over the area, false otherwise.
Bind it to a visual property to give the user feedback, for example a background color.
current-action
Section titled “current-action” enum DragAction (out) default: the first enum value
The action the runtime is currently negotiating with the source: none when no drag is hovering,
or copy/move/link once a concrete action is settled.
DragAction
This enum describes the action negotiated between the source of a drag (DragArea)
and its target (DropArea) during a drag-and-drop operation. The source declares
which actions it permits, the target picks one in its can-drop callback, and the
chosen action is reported back to the source via drag-finished so that, for
example, a move source can remove the original data. The same enum is used for
drags that come from another application or window once native drag-and-drop is
in play.
none: No action: the drag is rejected, no drop will be delivered.copy: The data is copied to the target; the source retains it.move: The data is moved to the target; the source should remove it once the operation completes.link: A link to the source data is created at the target; neither side gives up ownership.
© 2026 SixtyFPS GmbH