---
title: "destructive(_:action:)"
framework: swiftui
role: symbol
role_heading: Type Method
path: "swiftui/alert/button/destructive(_:action:)"
---

# destructive(_:action:)

Creates an alert button with a style that indicates a destructive action.

## Declaration

```swift
static func destructive(_ label: Text, action: (() -> Void)? = {}) -> Alert.Button
```

## Parameters

- `label`: The text to display on the button.
- `action`: A closure to execute when the user taps or presses the button.

## Return Value

Return Value An alert button that indicates a destructive action.

## See Also

### Getting a button

- [default(_:action:)](swiftui/alert/button/default(_:action:).md)
- [cancel(_:)](swiftui/alert/button/cancel(_:).md)
- [cancel(_:action:)](swiftui/alert/button/cancel(_:action:).md)
