---
title: destructive
framework: swiftui
role: symbol
role_heading: Type Property
path: swiftui/buttonrole/destructive
---

# destructive

A role that indicates a destructive button.

## Declaration

```swift
static let destructive: ButtonRole
```

## Mentioned in

Populating SwiftUI menus with adaptive controls

## Discussion

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:) 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")

## See Also

### Getting button roles

- [cancel](swiftui/buttonrole/cancel.md)
