<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/sheet(isPresented:onDismiss:content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE5sheet11isPresented9onDismiss7contentQrAA7BindingVySbG_yycSgqd__yctAaBRd__lF"
  },
  "title" : "sheet(isPresented:onDismiss:content:)"
}
-->

# sheet(isPresented:onDismiss:content:)

Presents a sheet when a binding to a Boolean value that you
provide is true.

```
nonisolated func sheet<Content>(isPresented: Binding<Bool>, onDismiss: (() -> Void)? = nil, @ContentBuilder content: @escaping () -> Content) -> some View where Content : View
```

## Parameters

`isPresented`

A binding to a Boolean value that determines whether
to present the sheet that you create in the modifier’s
`content` closure.

`onDismiss`

The closure to execute when dismissing the sheet.

`content`

A closure that returns the content of the sheet.

## Discussion

Use this method when you want to present a modal view to the
user when a Boolean value you provide is true. The example
below displays a modal view of the mockup for a software license
agreement when the user toggles the `isShowingSheet` variable by
clicking or tapping on the “Show License Agreement” button:

```
struct ShowLicenseAgreement: View {
    @State private var isShowingSheet = false
    var body: some View {
        Button(action: {
            isShowingSheet.toggle()
        }) {
            Text("Show License Agreement")
        }
        .sheet(isPresented: $isShowingSheet,
               onDismiss: didDismiss) {
            VStack {
                Text("License Agreement")
                    .font(.title)
                    .padding(50)
                Text("""
                        Terms and conditions go here.
                    """)
                    .padding(50)
                Button("Dismiss",
                       action: { isShowingSheet.toggle() })
            }
        }
    }

    func didDismiss() {
        // Handle the dismissing action.
    }
}
```

![A screenshot of a full-screen modal sheet showing the mockup of a](images/com.apple.SwiftUI/SwiftUI-View-SheetIsPresentingContent@2x.png)

In vertically compact environments, such as iPhone in landscape
orientation, a sheet presentation automatically adapts to appear as a
full-screen cover. Use the [`presentationCompactAdaptation(_:)`](/documentation/SwiftUI/View/presentationCompactAdaptation(_:)) or
[`presentationCompactAdaptation(horizontal:vertical:)`](/documentation/SwiftUI/View/presentationCompactAdaptation(horizontal:vertical:)) modifier to
override this behavior.

### Breakthrough effect

In visionOS, most system presentations appear with a breakthrough effect by
default. To change how the enclosing presentation breaks through
content occluding it, use [`presentationBreakthroughEffect(_:)`](/documentation/SwiftUI/View/presentationBreakthroughEffect(_:)),
like in the following example:

```swift
.sheet(isPresented: $isShowingSheet,
       onDismiss: didDismiss) {
    VStack {
        Text("License Agreement")
            .font(.title)
            .padding(50)
        Text("""
                Terms and conditions go here.
            """)
            .padding(50)
        Button("Dismiss",
               action: { isShowingSheet.toggle() })
    }
    .presentationBreakthroughEffect(.prominent)
}
```

> Passing a `.none` value for a sheet has no effect.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)