iPhone SwiftUI layouts

Explore SwiftUI APIs, components, and modifiers with interactive iPhone previews, Swift code, and Apple documentation. Compare every available orientation, appearance, and design.

Button

Role Button With Default Label

Creates a button that displays a default label.

Explore Role Button With Default Label on iPhone in portrait, with SwiftUI code and Apple API documentation.

NavigationStack {
    VStack {
        Button(role: .cancel, action: action)
        Button(role: .close, action: action)
        Button(role: .confirm, action: action)
        Button(role: .destructive, action: action)
        Spacer()
    }
    .toolbar {
        Button(role: .cancel, action: action)
        Button(role: .close, action: action)
        Button(role: .confirm, action: action)
        Button(role: .destructive, action: action)
    }
}
iOS 26.0+ iPadOS 26.0+ macOS 26.0+ watchOS 26.0+ tvOS 26.0+ visionOS 26.0+

Every available iPhone screenshot for Role Button With Default Label.

1 views