---
title: ButtonRole
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/buttonrole
---

# ButtonRole

A value that describes the purpose of a button.

## Declaration

```swift
struct ButtonRole
```

## Overview

Overview A button role provides a description of a button’s purpose.  For example, the destructive role indicates that a button performs a destructive action, like delete user data: Button("Delete", role: .destructive) { delete() }

## Topics

### Getting button roles

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

### Type Properties

- [close](swiftui/buttonrole/close.md)
- [confirm](swiftui/buttonrole/confirm.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Creating buttons

- [Button](swiftui/button.md)
- [buttonStyle(_:)](swiftui/view/buttonstyle(_:).md)
- [buttonBorderShape(_:)](swiftui/view/buttonbordershape(_:).md)
- [ButtonBorderShape](swiftui/buttonbordershape.md)
- [buttonRepeatBehavior(_:)](swiftui/view/buttonrepeatbehavior(_:).md)
- [ButtonRepeatBehavior](swiftui/buttonrepeatbehavior.md)
- [buttonRepeatBehavior](swiftui/environmentvalues/buttonrepeatbehavior.md)
- [buttonSizing(_:)](swiftui/view/buttonsizing(_:).md)
- [ButtonSizing](swiftui/buttonsizing.md)
