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
List Item Tint - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
modifier

List Item Tint

Sets a fixed tint color for content in a list.

ControlSize - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

ControlSize

A control version that is the default size

Picker Section - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
content

Picker Section

A Section inside a 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.

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

PaletteControlGroupStyle

A control group style that presents its content as a palette.

Collapse Sidebar Sections by Default - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Collapse Sidebar Sections by Default

Collapses the section in the sidebar by default.

List Row Separator Tint - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
modifier

List Row Separator Tint

Sets the tint color associated with a row.

Default Collapsed Tab Section - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Default Collapsed Tab Section

Sets the default expansion state for the section containing this tab to collapsed when displayed in the sidebar.