<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ButtonRole/destructive",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI10ButtonRoleV11destructiveACvpZ"
  },
  "title" : "destructive"
}
-->

# destructive

A role that indicates a destructive button.

```
static let destructive: ButtonRole
```

## Discussion

Use this role for a button that deletes user data, or performs an
irreversible operation. A destructive button signals by its appearance
that the user should carefully consider whether to tap or click the
button. For example, SwiftUI presents a destructive button that you add
with the [`swipeActions(edge:allowsFullSwipe:content:)`](/documentation/SwiftUI/View/swipeActions(edge:allowsFullSwipe:content:))
modifier using a red background:

```
List {
    ForEach(items) { item in
        Text(item.title)
            .swipeActions {
                Button(role: .destructive) { delete() } label: {
                    Label("Delete", systemImage: "trash")
                }
            }
    }
}
.navigationTitle("Shopping List")
```

![A screenshot of a list of three items, where the second item is](images/com.apple.SwiftUI/ButtonRole-destructive-1@2x.png)

---

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)