Button Roles

A value that describes the purpose of a button.

Button Roles - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Platform Compatibility

iOS 15.0+ iPadOS 15.0+ macOS 12.0+ watchOS 8.0+ tvOS 15.0+ visionOS 1.0+

Tags

SwiftUI Code

Docs
VStack {
    HStack {
        Button("Tap Me", role: .cancel, action: action)
            .buttonStyle(.plain)
        Button("Tap Me", role: .cancel, action: action)
            .buttonStyle(.borderless)
        Button("Tap Me", role: .cancel, action: action)
            .buttonStyle(.bordered)
        Button("Tap Me", role: .cancel, action: action)
            .buttonStyle(.borderedProminent)
    }
    HStack {
        Button("Tap Me", role: .destructive, action: action)
            .buttonStyle(.plain)
        Button("Tap Me", role: .destructive, action: action)
            .buttonStyle(.borderless)
        Button("Tap Me", role: .destructive, action: action)
            .buttonStyle(.bordered)
        Button("Tap Me", role: .destructive, action: action)
            .buttonStyle(.borderedProminent)
    }
}

Found an issue or have a suggestion?

Created: May 30, 2025Updated: August 18, 2026

More Button Components

View all
Button Sizing - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Button Sizing

The preferred sizing behavior of buttons in the view hierarchy.

Role Button With Default Label - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Role Button With Default Label

Creates a button that displays a default label.

Glass Button Styles - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Glass Button Styles

A button style that applies glass border artwork based on the button’s context

RenameButton - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
TextField

RenameButton

A button that triggers a standard rename action

EditButton - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
type

EditButton

A button that toggles the edit mode environment value

PasteButton - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
type

PasteButton

A system button that reads items from the pasteboard and delivers it to a closure.

Button Tint - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Button Tint

Sets the buttons tint color

Button Border Shape - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Button Border Shape

A shape used to draw a button’s border.

Explore Other Components

Browse all
Custom Photo Picker Buttons - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Custom Photo Picker Buttons

Sets the primary and secondary button types of the Photos picker.

RegularProductViewStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

RegularProductViewStyle

A style for a product view that uses a standard, platform-appropriate layout.

Store View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Store View

Creates a view to load and merchandise a collection of products from the App Store using product identifiers. Internally, ProductView is used, and therefore productViewStyle can also be applied here.

Inline Photos Picker Style - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Inline Photos Picker Style

A photos picker style that displays the picker inline without presenting a sheet.

Custom Session Async URL Image - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Custom Session Async URL Image

A modifier that adds a URL session for asynchronous images contained in the view to use when fetching image data.

LargeProductViewStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

LargeProductViewStyle

A style for a product view that’s suitable for layouts where the in-app purchase content is prominent.

Custom Icon Product View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Custom Icon Product View

Creates a view to load an individual product from the App Store and merchandise it using a custom icon.

Reserved Regions - iOS on iPhone Duo - Landscape - Partially Open - Liquid Glass - Light Mode - Preview
method

Reserved Regions

Returns the reserved regions for the given kind. A reserved region indicates that an area within a view’s coordinate space has been claimed by something the view does not own