---
title: "dropDestination(for:action:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/tabcontent/dropdestination(for:action:)"
---

# dropDestination(for:action:)

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

## Declaration

```swift
@MainActor @preconcurrency func dropDestination<T>(for payloadType: T.Type = T.self, action: @escaping ([T]) -> Void) -> some TabContent<Self.TabValue> where T : Transferable

```

## Parameters

- `payloadType`: Type of the models that are dropped.
- `action`: A closure that takes the dropped content and responds appropriately. The closure takes one argument, which is an array of Transferable items that represents the data to insert.

## Return Value

Return Value A view that calls action when elements are dropped onto the tab.

## Discussion

Discussion The dropped content can be provided as binary data, file URLs, or file promises. The drop destination is the tab content. This example adds a profile to a group when the user drops it onto onto that group. struct Profile: Identifiable {     let givenName: String     let familyName: String     let image = "person.fill"     let id = UUID().uuidString }

@State private var profiles = [     Profile(givenName: "Juan", familyName: "Chavez"),     Profile(givenName: "Mei", familyName: "Chen"),     Profile(givenName: "Tom", familyName: "Clark"),     Profile(givenName: "Gita", familyName: "Kumar") ]

@State private var favoriteProfiles: [Profile] = []

var body: some View {     TabView {         Tab("All Profiles", systemImage: "list.bullet") {             List(profiles) { profile in                 Text(profile.givenName)                     .draggable(profile.id)             }         }

Tab("Favorites", systemImage: "star.fill") {             ForEach(favoritedProfiles) { profile in                 Tab(profile.givenName, image: profile.image) {                     Label(profile.givenName, systemImage: "star.fill")                 }             }         }         .dropDestination(for: String.self) { receivedIds in              // Add profiles with `receivedIds` to favorites         }    }

## See Also

### Configuring tab content

- [badge(_:)](swiftui/tabcontent/badge(_:).md)
- [contextMenu(menuItems:)](swiftui/tabcontent/contextmenu(menuitems:).md)
- [customizationBehavior(_:for:)](swiftui/tabcontent/customizationbehavior(_:for:).md)
- [customizationID(_:)](swiftui/tabcontent/customizationid(_:).md)
- [defaultSectionExpansion(_:)](swiftui/tabcontent/defaultsectionexpansion(_:).md)
- [TabSectionExpansion](swiftui/tabsectionexpansion.md)
- [defaultVisibility(_:for:)](swiftui/tabcontent/defaultvisibility(_:for:).md)
- [disabled(_:)](swiftui/tabcontent/disabled(_:).md)
- [draggable(_:)](swiftui/tabcontent/draggable(_:).md)
- [help(_:)](swiftui/tabcontent/help(_:).md)
- [hidden(_:)](swiftui/tabcontent/hidden(_:).md)
- [popover(isPresented:attachmentAnchor:arrowEdge:content:)](swiftui/tabcontent/popover(ispresented:attachmentanchor:arrowedge:content:).md)
- [popover(item:attachmentAnchor:arrowEdge:content:)](swiftui/tabcontent/popover(item:attachmentanchor:arrowedge:content:).md)
- [sectionActions(content:)](swiftui/tabcontent/sectionactions(content:).md)
- [springLoadingBehavior(_:)](swiftui/tabcontent/springloadingbehavior(_:).md)
