<!--
{
  "documentType" : "article",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View-Presentation",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Presentation modifiers"
}
-->

# Presentation modifiers

Define additional views for the view to present under specified conditions.

## Overview

Use presentation modifiers to show different kinds of modal presentations,
like alerts, popovers, sheets, and confirmation dialogs.

Because SwiftUI is a declarative framework, you don’t call a method at the
moment you want to present the modal. Rather, you define how the presentation
looks and the condition under which SwiftUI should present it. SwiftUI
detects when the condition changes and makes the presentation for you.
Because you provide a [`Binding`](/documentation/SwiftUI/Binding) to the condition that initiates the
presentation, SwiftUI can reset the underlying value when the user dismisses
the presentation.

For more information about how to use these modifiers, see
[Modal presentations](/documentation/SwiftUI/Modal-presentations).

## Topics

### Alerts

[`alert(_:isPresented:actions:)`](/documentation/SwiftUI/View/alert(_:isPresented:actions:))

Presents an alert when a given condition is true, using a localized
string resource for the title.

[`alert(_:isPresented:presenting:actions:)`](/documentation/SwiftUI/View/alert(_:isPresented:presenting:actions:))

Presents an alert using the given data to produce the alert’s content
and a localized string resource for a title.

[`alert(_:item:actions:)`](/documentation/SwiftUI/View/alert(_:item:actions:))

Presents an alert using the given data to produce the alert’s content
and a text view as a title.

[`alert(error:actions:)`](/documentation/SwiftUI/View/alert(error:actions:))

Presents an alert when an error is present.

[`alert(isPresented:error:actions:)`](/documentation/SwiftUI/View/alert(isPresented:error:actions:))

Presents an alert when an error is present.

### Alerts with a message

[`alert(_:isPresented:actions:message:)`](/documentation/SwiftUI/View/alert(_:isPresented:actions:message:))

Presents an alert with a message when a given condition is true, using
a localized string resource for a title.

[`alert(_:isPresented:presenting:actions:message:)`](/documentation/SwiftUI/View/alert(_:isPresented:presenting:actions:message:))

Presents an alert with a message using the given data to produce the
alert’s content and a localized string resource for a title.

[`alert(_:item:actions:message:)`](/documentation/SwiftUI/View/alert(_:item:actions:message:))

Presents an alert with a message using the given data to produce the
alert’s content and a localized string key for a title.

[`alert(error:actions:message:)`](/documentation/SwiftUI/View/alert(error:actions:message:))

Presents an alert with a message when an error is present.

[`alert(isPresented:error:actions:message:)`](/documentation/SwiftUI/View/alert(isPresented:error:actions:message:))

Presents an alert with a message when an error is present.

### Confirmation dialogs

[`confirmationDialog(_:isPresented:titleVisibility:actions:)`](/documentation/SwiftUI/View/confirmationDialog(_:isPresented:titleVisibility:actions:))

Presents a confirmation dialog when a given condition is true, using a
localized string resource for the title.

[`confirmationDialog(_:isPresented:titleVisibility:presenting:actions:)`](/documentation/SwiftUI/View/confirmationDialog(_:isPresented:titleVisibility:presenting:actions:))

Presents a confirmation dialog using data to produce the dialog’s
content and a localized string resource for the title.

[`confirmationDialog(_:item:titleVisibility:actions:)`](/documentation/SwiftUI/View/confirmationDialog(_:item:titleVisibility:actions:))

Presents a confirmation dialog using data to produce the dialog’s
content and a text view for the title.

[`dismissalConfirmationDialog(_:shouldPresent:actions:)`](/documentation/SwiftUI/View/dismissalConfirmationDialog(_:shouldPresent:actions:))

Presents a confirmation dialog when a dismiss action has been triggered.

### Confirmation dialogs with a message

[`confirmationDialog(_:isPresented:titleVisibility:actions:message:)`](/documentation/SwiftUI/View/confirmationDialog(_:isPresented:titleVisibility:actions:message:))

Presents a confirmation dialog with a message when a given condition is
true, using a localized string resource for the title.

[`confirmationDialog(_:isPresented:titleVisibility:presenting:actions:message:)`](/documentation/SwiftUI/View/confirmationDialog(_:isPresented:titleVisibility:presenting:actions:message:))

Presents a confirmation dialog with a message using data to produce the
dialog’s content and a localized string resource for the title.

[`confirmationDialog(_:item:titleVisibility:actions:message:)`](/documentation/SwiftUI/View/confirmationDialog(_:item:titleVisibility:actions:message:))

Presents a confirmation dialog with a message using data to produce the
dialog’s content and a text view for the message.

[`dismissalConfirmationDialog(_:shouldPresent:actions:message:)`](/documentation/SwiftUI/View/dismissalConfirmationDialog(_:shouldPresent:actions:message:))

Presents a confirmation dialog when a dismiss action has been triggered.

### Dialog configuration

[`dialogIcon(_:)`](/documentation/SwiftUI/View/dialogIcon(_:))

Configures the icon used by dialogs within this view.

[`dialogSeverity(_:)`](/documentation/SwiftUI/View/dialogSeverity(_:))

[`dialogSuppressionToggle(isSuppressed:)`](/documentation/SwiftUI/View/dialogSuppressionToggle(isSuppressed:))

Enables user suppression of dialogs and alerts presented within `self`,
with a default suppression message on macOS. Unused on other platforms.

[`dialogSuppressionToggle(_:isSuppressed:)`](/documentation/SwiftUI/View/dialogSuppressionToggle(_:isSuppressed:))

Enables user suppression of dialogs and alerts presented within `self`,
with a custom suppression message on macOS. Unused on other platforms.

[`dialogPreventsAppTermination(_:)`](/documentation/SwiftUI/View/dialogPreventsAppTermination(_:))

Whether the alert or confirmation dialog prevents the app
from being quit/terminated by the system or app termination menu item.

### Sheets

[`sheet(isPresented:onDismiss:content:)`](/documentation/SwiftUI/View/sheet(isPresented:onDismiss:content:))

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

[`sheet(item:onDismiss:content:)`](/documentation/SwiftUI/View/sheet(item:onDismiss:content:))

Presents a sheet using the given item as a data source
for the sheet’s content.

[`fullScreenCover(isPresented:onDismiss:content:)`](/documentation/SwiftUI/View/fullScreenCover(isPresented:onDismiss:content:))

Presents a modal view that covers as much of the screen as
possible when binding to a Boolean value you provide is true.

[`fullScreenCover(item:onDismiss:content:)`](/documentation/SwiftUI/View/fullScreenCover(item:onDismiss:content:))

Presents a modal view that covers as much of the screen as
possible using the binding you provide as a data source for the
sheet’s content.

### Popovers

[`popover(item:attachmentAnchor:arrowEdge:content:)`](/documentation/SwiftUI/View/popover(item:attachmentAnchor:arrowEdge:content:))

Presents a popover using the given item as a data source for the
popover’s content.

[`popover(isPresented:attachmentAnchor:arrowEdge:content:)`](/documentation/SwiftUI/View/popover(isPresented:attachmentAnchor:arrowEdge:content:))

Presents a popover when a given condition is true.

### Sheet and popover configuration

[`interactiveDismissDisabled(_:)`](/documentation/SwiftUI/View/interactiveDismissDisabled(_:))

Conditionally prevents interactive dismissal of presentations like
popovers, sheets, and inspectors.

[`presentationDetents(_:)`](/documentation/SwiftUI/View/presentationDetents(_:))

Sets the available detents for the enclosing sheet.

[`presentationDetents(_:selection:)`](/documentation/SwiftUI/View/presentationDetents(_:selection:))

Sets the available detents for the enclosing sheet, giving you
programmatic control of the currently selected detent.

[`presentationDragIndicator(_:)`](/documentation/SwiftUI/View/presentationDragIndicator(_:))

Sets the visibility of the drag indicator on top of a sheet.

[`presentationBackground(_:)`](/documentation/SwiftUI/View/presentationBackground(_:))

Sets the presentation background of the enclosing sheet using a shape
style.

[`presentationBackground(alignment:content:)`](/documentation/SwiftUI/View/presentationBackground(alignment:content:))

Sets the presentation background of the enclosing sheet to a custom
view.

[`presentationBackgroundInteraction(_:)`](/documentation/SwiftUI/View/presentationBackgroundInteraction(_:))

Controls whether people can interact with the view behind a
presentation.

[`presentationCompactAdaptation(horizontal:vertical:)`](/documentation/SwiftUI/View/presentationCompactAdaptation(horizontal:vertical:))

Specifies how to adapt a presentation to horizontally and vertically
compact size classes.

[`presentationCompactAdaptation(_:)`](/documentation/SwiftUI/View/presentationCompactAdaptation(_:))

Specifies how to adapt a presentation to compact size classes.

[`presentationContentInteraction(_:)`](/documentation/SwiftUI/View/presentationContentInteraction(_:))

Configures the behavior of swipe gestures on a presentation.

[`presentationCornerRadius(_:)`](/documentation/SwiftUI/View/presentationCornerRadius(_:))

Requests that the presentation have a specific corner radius.

[`presentationSizing(_:)`](/documentation/SwiftUI/View/presentationSizing(_:))

Sets the sizing of the containing presentation.

[`presentationBreakthroughEffect(_:)`](/documentation/SwiftUI/View/presentationBreakthroughEffect(_:))

Changes the way the enclosing presentation breaks through content
occluding it.

[`presentationPreventsAppTermination(_:)`](/documentation/SwiftUI/View/presentationPreventsAppTermination(_:))

Whether a presentation prevents the app from being terminated/quit
by the system or app termination menu item.

### File exporter

[`fileExporter(isPresented:document:contentType:defaultFilename:onCompletion:)`](/documentation/SwiftUI/View/fileExporter(isPresented:document:contentType:defaultFilename:onCompletion:))

Presents a system dialog for exporting a document that’s stored in
a value type, like a structure, to a file on disk.

[`fileExporter(isPresented:documents:contentType:onCompletion:)`](/documentation/SwiftUI/View/fileExporter(isPresented:documents:contentType:onCompletion:))

Presents a system dialog for exporting a collection of value type
documents to files on disk.

[`fileExporter(isPresented:document:contentType:defaultFilename:onCompletion:onCancellation:)`](/documentation/SwiftUI/View/fileExporter(isPresented:document:contentType:defaultFilename:onCompletion:onCancellation:))

Presents a system dialog for allowing the user to export a
`WritableDocument` to a file on disk.

[`fileExporter(isPresented:document:contentTypes:defaultFilename:onCompletion:onCancellation:)`](/documentation/SwiftUI/View/fileExporter(isPresented:document:contentTypes:defaultFilename:onCompletion:onCancellation:))

Presents a system dialog for allowing the user to export a
`FileDocument` to a file on disk.

[`fileExporter(isPresented:documents:contentTypes:onCompletion:onCancellation:)`](/documentation/SwiftUI/View/fileExporter(isPresented:documents:contentTypes:onCompletion:onCancellation:))

Presents a system dialog for allowing the user to export a
collection of objects conforming to `WritableDocument` to files
on disk.

[`fileExporter(isPresented:item:contentTypes:defaultFilename:onCompletion:onCancellation:)`](/documentation/SwiftUI/View/fileExporter(isPresented:item:contentTypes:defaultFilename:onCompletion:onCancellation:))

Presents a system dialog allowing the user to export
a `Transferable` item to a file on disk.

[`fileExporter(isPresented:items:contentTypes:onCompletion:onCancellation:)`](/documentation/SwiftUI/View/fileExporter(isPresented:items:contentTypes:onCompletion:onCancellation:))

Presents a system dialog allowing the user to export
a collection of `Transferable` items to files on disk.

[`fileExporterFilenameLabel(_:)`](/documentation/SwiftUI/View/fileExporterFilenameLabel(_:))

On macOS, configures the `fileExporter`
with a label for the file name field.

### File importer

[`fileImporter(isPresented:allowedContentTypes:allowsMultipleSelection:onCompletion:)`](/documentation/SwiftUI/View/fileImporter(isPresented:allowedContentTypes:allowsMultipleSelection:onCompletion:))

Presents a system dialog for allowing the user to import multiple
files.

[`fileImporter(isPresented:allowedContentTypes:onCompletion:)`](/documentation/SwiftUI/View/fileImporter(isPresented:allowedContentTypes:onCompletion:))

Presents a system dialog for allowing the user to import an existing
file.

[`fileImporter(isPresented:allowedContentTypes:allowsMultipleSelection:onCompletion:onCancellation:)`](/documentation/SwiftUI/View/fileImporter(isPresented:allowedContentTypes:allowsMultipleSelection:onCompletion:onCancellation:))

Presents a system dialog for allowing the user to import multiple
files.

### File mover

[`fileMover(isPresented:file:onCompletion:)`](/documentation/SwiftUI/View/fileMover(isPresented:file:onCompletion:))

Presents a system dialog for allowing the user to move an existing
file to a new location.

[`fileMover(isPresented:files:onCompletion:)`](/documentation/SwiftUI/View/fileMover(isPresented:files:onCompletion:))

Presents a system dialog for allowing the user to move a collection
of existing files to a new location.

[`fileMover(isPresented:file:onCompletion:onCancellation:)`](/documentation/SwiftUI/View/fileMover(isPresented:file:onCompletion:onCancellation:))

Presents a system dialog for allowing the user to move
an existing file to a new location.

[`fileMover(isPresented:files:onCompletion:onCancellation:)`](/documentation/SwiftUI/View/fileMover(isPresented:files:onCompletion:onCancellation:))

Presents a system dialog for allowing the user to move
a collection of existing files to a new location.

### File dialog configuration

[`fileDialogBrowserOptions(_:)`](/documentation/SwiftUI/View/fileDialogBrowserOptions(_:))

On macOS, configures the `fileExporter`, `fileImporter`,
or `fileMover` to provide a refined URL search experience: include or exclude
hidden files, allow searching by tag, etc.

[`fileDialogConfirmationLabel(_:)`](/documentation/SwiftUI/View/fileDialogConfirmationLabel(_:))

On macOS, configures the `fileExporter`, `fileImporter`,
or `fileMover` with a custom confirmation button label.

[`fileDialogCustomizationID(_:)`](/documentation/SwiftUI/View/fileDialogCustomizationID(_:))

On macOS, configures the `fileExporter`, `fileImporter`,
or `fileMover` to persist and restore the file dialog configuration.

[`fileDialogDefaultDirectory(_:)`](/documentation/SwiftUI/View/fileDialogDefaultDirectory(_:))

Configures the `fileExporter`, `fileImporter`, or `fileMover` to
open with the specified default directory.

[`fileDialogImportsUnresolvedAliases(_:)`](/documentation/SwiftUI/View/fileDialogImportsUnresolvedAliases(_:))

On macOS, configures the `fileExporter`, `fileImporter`,
or `fileMover` behavior when a user chooses an alias.

[`fileDialogMessage(_:)`](/documentation/SwiftUI/View/fileDialogMessage(_:))

On macOS, configures the `fileExporter`, `fileImporter`,
or `fileMover` with a custom message that is presented to the user,
similar to a title.

[`fileDialogURLEnabled(_:)`](/documentation/SwiftUI/View/fileDialogURLEnabled(_:))

On macOS, configures the `fileImporter`
or `fileMover` to conditionally disable presented URLs.

### Foveated streaming

[`foveatedStreamingPauseSheet(session:)`](/documentation/SwiftUI/View/foveatedStreamingPauseSheet(session:))

Tells the system to present a sheet with controls for resuming or ending the foveated streaming session when it pauses.

### Screen capture

[`recordingEditor(_:)`](/documentation/SwiftUI/View/recordingEditor(_:))

Presents the recording editor for the given recording URL.

[`recordingEditor(_:mode:)`](/documentation/SwiftUI/View/recordingEditor(_:mode:))

Presents the recording editor for the given recording URL with a specific mode.

### Document browser

[`documentLaunchTitle(_:)`](/documentation/SwiftUI/View/documentLaunchTitle(_:))

Sets the title displayed on the document launch card.

[`documentLaunchSubtitle(_:)`](/documentation/SwiftUI/View/documentLaunchSubtitle(_:))

Sets the subtitle displayed beneath the title on the document
launch card.

[`documentBrowserContextMenu(_:)`](/documentation/SwiftUI/View/documentBrowserContextMenu(_:))

Adds to a `DocumentLaunchView` actions that accept
a list of selected files as their parameter.

### Inspectors

[`inspector(isPresented:content:)`](/documentation/SwiftUI/View/inspector(isPresented:content:))

Inserts an inspector at the applied position in the view hierarchy.

[`inspectorColumnWidth(_:)`](/documentation/SwiftUI/View/inspectorColumnWidth(_:))

Sets a fixed, preferred width for the inspector containing this view
when presented as a trailing column.

[`inspectorColumnWidth(min:ideal:max:)`](/documentation/SwiftUI/View/inspectorColumnWidth(min:ideal:max:))

Sets a flexible, preferred width for the inspector in a trailing-column
presentation.

### Quick look previews

[`quickLookPreview(_:)`](/documentation/SwiftUI/View/quickLookPreview(_:))

Presents a Quick Look preview of the contents of a single URL.

[`quickLookPreview(_:in:)`](/documentation/SwiftUI/View/quickLookPreview(_:in:))

Presents a Quick Look preview of the URLs you provide.

### Family Sharing

[`familyActivityPicker(isPresented:selection:)`](/documentation/SwiftUI/View/familyActivityPicker(isPresented:selection:))

Presents an activity picker view as a sheet.

[`familyActivityPicker(headerText:footerText:isPresented:selection:)`](/documentation/SwiftUI/View/familyActivityPicker(headerText:footerText:isPresented:selection:))

Presents an activity picker view as a sheet.

[`familyActivityPicker(title:headerText:footerText:isPresented:selection:)`](/documentation/SwiftUI/View/familyActivityPicker(title:headerText:footerText:isPresented:selection:))

Present an activity picker sheet for selecting apps and websites to manage.

### Live Activities

[`activitySystemActionForegroundColor(_:)`](/documentation/SwiftUI/View/activitySystemActionForegroundColor(_:))

The text color for the auxiliary action button that the system shows next to a Live Activity on the
Lock Screen.

[`activityBackgroundTint(_:)`](/documentation/SwiftUI/View/activityBackgroundTint(_:))

Sets the tint color for the background of a Live Activity that appears on the Lock Screen.

### Game saving

[`gameSaveSyncingAlert(directory:finishedLoading:)`](/documentation/SwiftUI/View/gameSaveSyncingAlert(directory:finishedLoading:))

Presents a modal view while the game synced directory loads.

### Apple Music

[`musicSubscriptionOffer(isPresented:options:onLoadCompletion:)`](/documentation/SwiftUI/View/musicSubscriptionOffer(isPresented:options:onLoadCompletion:))

Initiates the process of presenting a sheet with subscription offers
for Apple Music when the `isPresented` binding is `true`.

### Contacts

[`contactAccessButtonCaption(_:)`](/documentation/SwiftUI/View/contactAccessButtonCaption(_:))

[`contactAccessButtonStyle(_:)`](/documentation/SwiftUI/View/contactAccessButtonStyle(_:))

[`contactAccessPicker(isPresented:completionHandler:)`](/documentation/SwiftUI/View/contactAccessPicker(isPresented:completionHandler:))

Modally present UI which allows the user to select which
contacts your app has access to.

### StoreKit

[`appStoreOverlay(isPresented:configuration:)`](/documentation/SwiftUI/View/appStoreOverlay(isPresented:configuration:))

Presents a StoreKit overlay when a given condition is true.

[`appStoreMerchandising(isPresented:kind:onDismiss:)`](/documentation/SwiftUI/View/appStoreMerchandising(isPresented:kind:onDismiss:))

Display a merchandising view.

[`manageSubscriptionsSheet(isPresented:)`](/documentation/SwiftUI/View/manageSubscriptionsSheet(isPresented:))

[`refundRequestSheet(for:isPresented:onDismiss:)`](/documentation/SwiftUI/View/refundRequestSheet(for:isPresented:onDismiss:))

Display the refund request sheet for the given transaction.

[`offerCodeRedemption(options:isPresented:onCompletion:)`](/documentation/SwiftUI/View/offerCodeRedemption(options:isPresented:onCompletion:))

Presents a sheet that enables customers to redeem offer
codes that you configure in App Store Connect.

### PhotoKit

[`photosPicker(isPresented:selection:matching:preferredItemEncoding:)`](/documentation/SwiftUI/View/photosPicker(isPresented:selection:matching:preferredItemEncoding:))

Presents a Photos picker that selects a `PhotosPickerItem`.

[`photosPicker(isPresented:selection:matching:preferredItemEncoding:photoLibrary:)`](/documentation/SwiftUI/View/photosPicker(isPresented:selection:matching:preferredItemEncoding:photoLibrary:))

Presents a Photos picker that selects a `PhotosPickerItem` from a given photo library.

[`photosPicker(isPresented:selection:maxSelectionCount:selectionBehavior:matching:preferredItemEncoding:)`](/documentation/SwiftUI/View/photosPicker(isPresented:selection:maxSelectionCount:selectionBehavior:matching:preferredItemEncoding:))

Presents a Photos picker that selects a collection of `PhotosPickerItem`.

[`photosPicker(isPresented:selection:maxSelectionCount:selectionBehavior:matching:preferredItemEncoding:photoLibrary:)`](/documentation/SwiftUI/View/photosPicker(isPresented:selection:maxSelectionCount:selectionBehavior:matching:preferredItemEncoding:photoLibrary:))

Presents a Photos picker that selects a collection of `PhotosPickerItem` from a given photo library.

[`photosPickerAccessoryVisibility(_:edges:)`](/documentation/SwiftUI/View/photosPickerAccessoryVisibility(_:edges:))

Sets the accessory visibility of the Photos picker. Accessories include anything between the content and the edge, like the navigation bar or the sidebar.

[`photosPickerDisabledCapabilities(_:)`](/documentation/SwiftUI/View/photosPickerDisabledCapabilities(_:))

Disables capabilities of the Photos picker.

[`photosPickerSearchText(_:)`](/documentation/SwiftUI/View/photosPickerSearchText(_:))

Sets search text of the Photos picker.

[`photosPickerStyle(_:)`](/documentation/SwiftUI/View/photosPickerStyle(_:))

Sets the mode of the Photos picker.

[`photosSharedAlbumCreationSheet(isPresented:defaultTitle:defaultSharingPolicy:photoLibrary:onCompletion:)`](/documentation/SwiftUI/View/photosSharedAlbumCreationSheet(isPresented:defaultTitle:defaultSharingPolicy:photoLibrary:onCompletion:))

Presents a view for allowing the user to create a new shared album.

[`photosSharedAlbumCustomizationSheet(isPresented:albumIdentifier:photoLibrary:onCompletion:)`](/documentation/SwiftUI/View/photosSharedAlbumCustomizationSheet(isPresented:albumIdentifier:photoLibrary:onCompletion:))

Presents a view for allowing the user to customize a specified shared album.

[`photosSharedAlbumPostingSheet(isPresented:items:defaultAlbumIdentifier:photoLibrary:completion:)`](/documentation/SwiftUI/View/photosSharedAlbumPostingSheet(isPresented:items:defaultAlbumIdentifier:photoLibrary:completion:))

Presents an “Add to Shared Album” sheet that allows the user to post the given items to a shared album.

### Translation

[`translationPresentation(isPresented:text:attachmentAnchor:arrowEdge:replacementAction:)`](/documentation/SwiftUI/View/translationPresentation(isPresented:text:attachmentAnchor:arrowEdge:replacementAction:))

Presents a translation popover when a given condition is true.

[`translationTask(_:action:)`](/documentation/SwiftUI/View/translationTask(_:action:))

Adds a task to perform before this view appears or when the translation configuration changes.

[`translationTask(source:target:action:)`](/documentation/SwiftUI/View/translationTask(source:target:action:))

Adds a task to perform before this view appears or when the specified source or target
languages change.

[`translationTask(source:target:preferredStrategy:action:)`](/documentation/SwiftUI/View/translationTask(source:target:preferredStrategy:action:))

Adds a task to perform before this view appears or when the specified source or target
languages change.

### Security

[`certificateSheet(trust:title:message:help:)`](/documentation/SwiftUI/View/certificateSheet(trust:title:message:help:))

Displays a certificate sheet using the provided certificate trust.



---

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)