presentationCornerRadius

Requests that the presentation have a specific corner radius.

View ModifieriOS 16.4+macOS 13.3+tvOS 16.4+watchOS 9.4+presentationCornerRadius(_:) in SwiftUI

Declaration

React
compose().presentationCornerRadius(cornerRadius: number | null)
Swift
nonisolated func presentationCornerRadius(
    _ cornerRadius: CGFloat?
) -> some View

Parameters

  • cornerRadius*number | null

    The corner radius, or nil to use the system default.

Discussion

Use this modifier to change the corner radius of a presentation.

struct ContentView: View {
    @State private var showSettings = false

    var body: some View {
        Button("View Settings") {
            showSettings = true
        }
        .sheet(isPresented: $showSettings) {
            SettingsView()
                .presentationDetents([.medium, .large])
                .presentationCornerRadius(21)
        }
    }
}

or macOS.

See also

More in Presentation.