<!--
{
  "documentType" : "article",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Drag-and-drop",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Drag and drop"
}
-->

# Drag and drop

Enable people to move or duplicate items by dragging them from one location to another.

## Overview

Drag and drop offers people a convenient way to move content from one part of your app to another, from one app to another, or to reorder content using an intuitive dragging gesture. Support this feature in your app by adding view modifiers to potential source and destination views within your app’s interface.

![](images/com.apple.SwiftUI/drag-and-drop-hero@2x.png)

In your modifiers, provide or accept types that conform to the <doc://com.apple.documentation/documentation/CoreTransferable/Transferable> protocol, or that conform to <doc://com.apple.documentation/documentation/Foundation/NSItemProviderReading> and/or <doc://com.apple.documentation/documentation/Foundation/NSItemProviderWriting>. In Swift, prefer using transferable items.

For design guidance, see <doc://com.apple.documentation/design/Human-Interface-Guidelines/drag-and-drop> in the Human Interface Guidelines.

## Topics

### Essentials

[Adopting drag and drop using SwiftUI](/documentation/SwiftUI/Adopting-drag-and-drop-using-SwiftUI)

Enable drag-and-drop interactions in lists, tables and custom views.

[Making a view into a drag source](/documentation/SwiftUI/Making-a-view-into-a-drag-source)

Adopt draggable API to provide items for drag-and-drop operations.

[Reordering items in lists, stacks, grids, and custom layouts](/documentation/SwiftUI/Reordering-items-in-lists-stacks-grids-and-custom-layouts)

Add drag-to-reorder interactions to SwiftUI layouts using reordering modifiers.

### Configuring drag-and-drop behavior

[`dragConfiguration(_:)`](/documentation/SwiftUI/View/dragConfiguration(_:))

Configures a drag session.

[`DragConfiguration`](/documentation/SwiftUI/DragConfiguration)

The behavior of the drag, proposed by the dragging source.
A value that describes the drag operations a drag source supports.

[`dropConfiguration(_:)`](/documentation/SwiftUI/View/dropConfiguration(_:))

Configures a drop session.

[`DropConfiguration`](/documentation/SwiftUI/DropConfiguration)

Describes the behavior of the drop.

[`dragContainer(for:in:_:)`](/documentation/SwiftUI/View/dragContainer(for:in:_:))

A container with draggable views where the drag payload is based
on multiple identifiers of dragged items.

[`dragContainer(for:itemID:in:_:)`](/documentation/SwiftUI/View/dragContainer(for:itemID:in:_:))

A container with draggable views.

[`dragContainerSelection(_:containerNamespace:)`](/documentation/SwiftUI/View/dragContainerSelection(_:containerNamespace:))

Provides multiple item selection support for drag containers.

### Moving items

[`DragSession`](/documentation/SwiftUI/DragSession)

Describes the ongoing dragging session.

[`DropSession`](/documentation/SwiftUI/DropSession)

### Moving transferable items

[`draggable(_:)`](/documentation/SwiftUI/View/draggable(_:))

Activates this view as the source of a drag and drop operation.

[`draggable(_:preview:)`](/documentation/SwiftUI/View/draggable(_:preview:))

Activates this view as the source of a drag and drop operation.

[`draggable(_:containerNamespace:_:)`](/documentation/SwiftUI/View/draggable(_:containerNamespace:_:))

Activates this view as the source of a drag and drop operation,
allowing to provide optional identifiable
payload and specify the namespace of the drag container this view
belongs to.

[`draggable(_:id:containerNamespace:_:)`](/documentation/SwiftUI/View/draggable(_:id:containerNamespace:_:))

Activates this view as the source of a drag and drop operation, allowing
to provide optional payload and specify the namespace
of the drag container this view belongs to.

[`draggable(_:id:item:containerNamespace:)`](/documentation/SwiftUI/View/draggable(_:id:item:containerNamespace:))

Activates this view as the source of a drag and drop operation,
allowing to provide optional payload and specify the namespace of
the drag container this view belongs to.

[`draggable(_:item:containerNamespace:)`](/documentation/SwiftUI/View/draggable(_:item:containerNamespace:))

Activates this view as the source of a drag and drop operation, allowing
to provide optional identifiable payload and specify the namespace
of the drag container this view belongs to.

[`draggable(containerItemID:containerNamespace:)`](/documentation/SwiftUI/View/draggable(containerItemID:containerNamespace:))

Inside a drag container, activates this view as the source
of a drag and drop operation. Supports lazy drag containers.

### Moving items using item providers

[`itemProvider(_:)`](/documentation/SwiftUI/View/itemProvider(_:))

Provides a closure that vends the drag representation to be used for a
particular data element.

[`onDrag(_:preview:)`](/documentation/SwiftUI/View/onDrag(_:preview:))

Activates this view as the source of a drag and drop operation.

[`onDrag(_:)`](/documentation/SwiftUI/View/onDrag(_:))

Activates this view as the source of a drag and drop operation.

[`onDrop(of:isTargeted:perform:)`](/documentation/SwiftUI/View/onDrop(of:isTargeted:perform:))

Defines the destination of a drag-and-drop operation that handles the
dropped content with a closure that you specify.

[`onDrop(of:delegate:)`](/documentation/SwiftUI/View/onDrop(of:delegate:))

Defines the destination of a drag and drop operation using behavior
controlled by the delegate that you provide.

[`DropDelegate`](/documentation/SwiftUI/DropDelegate)

An interface that you implement to interact with a drop operation in a view
modified to accept drops.

[`DropProposal`](/documentation/SwiftUI/DropProposal)

The behavior of a drop.

[`DropOperation`](/documentation/SwiftUI/DropOperation)

Operation types that determine how a drag and drop session resolves when the
user drops a drag item.

[`DropInfo`](/documentation/SwiftUI/DropInfo)

The current state of a drop.

### Reordering items

[Making a card game with drag, drop, and reordering in SwiftUI](/documentation/SwiftUI/Making-a-card-game-with-drag-drop-and-reordering-in-swiftui)

Move cards between positions in a card game using drag, drop, and reordering modifiers.

[`reorderable()`](/documentation/SwiftUI/DynamicViewContent/reorderable())

Enables reordering of views from this content inside the scope of a
reorderable container modifier.

[`reorderable(collectionID:)`](/documentation/SwiftUI/DynamicViewContent/reorderable(collectionID:))

Enables reordering views from this content within and between sections
in the scope of a reorderable container modifier.

[`ReorderableSingleCollectionIdentifier`](/documentation/SwiftUI/ReorderableSingleCollectionIdentifier)

An opaque, empty type used to identify reorderable containers and modifiers
with only a single collection.

[`reorderContainer(for:isEnabled:move:)`](/documentation/SwiftUI/View/reorderContainer(for:isEnabled:move:))

Defines a container of reorderable views.

[`reorderContainer(for:in:isEnabled:move:)`](/documentation/SwiftUI/View/reorderContainer(for:in:isEnabled:move:))

Defines a container of reorderable views, with a type you specify to
identify sections.

[`reorderContainer(for:itemID:isEnabled:move:)`](/documentation/SwiftUI/View/reorderContainer(for:itemID:isEnabled:move:))

Defines a container of reorderable views, with a type and keypath you
specify to identify items.

[`reorderContainer(for:itemID:in:isEnabled:move:)`](/documentation/SwiftUI/View/reorderContainer(for:itemID:in:isEnabled:move:))

Defines a container of reorderable views, with a type and keypath you
use to identify items and a type you use to identify collections.

[`reorderDestination(for:in:)`](/documentation/SwiftUI/DropSession/reorderDestination(for:in:))

Provides the destination value of a reordering operation that occurred
in the container associated with this drop destination modifier.

[`reorderDestination(for:itemID:in:)`](/documentation/SwiftUI/DropSession/reorderDestination(for:itemID:in:))

Provides the destination value of a reordering operation that occurred
in the container associated with this drop destination modifier.

[`ReorderDifference`](/documentation/SwiftUI/ReorderDifference)

The difference that a reordering operation produces.

### Describing preview formations

[`dragPreviewsFormation(_:)`](/documentation/SwiftUI/View/dragPreviewsFormation(_:))

Describes the way dragged previews are visually composed.

[`dropPreviewsFormation(_:)`](/documentation/SwiftUI/View/dropPreviewsFormation(_:))

Describes the way previews for a drop are composed.

[`DragDropPreviewsFormation`](/documentation/SwiftUI/DragDropPreviewsFormation)

On macOS, describes the way the dragged previews are visually composed.
Both drag sources and drop destination can specify their desired preview formation.

### Configuring spring loading

[`springLoadingBehavior(_:)`](/documentation/SwiftUI/View/springLoadingBehavior(_:))

Sets the spring loading behavior this view.

[`springLoadingBehavior`](/documentation/SwiftUI/EnvironmentValues/springLoadingBehavior)

The behavior of spring loaded interactions for the views associated
with this environment.

[`SpringLoadingBehavior`](/documentation/SwiftUI/SpringLoadingBehavior)

The options for controlling the spring loading behavior of views.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)