boolean (or URL) state and toggles presentation when that state changes.
sheet and fullScreenCover are the two primary modal patterns. Combine sheet with presentationDetents to control sheet snap heights. quickLookPreview opens the system Quick Look UI for documents, images, and 3D models.
sheet
Presents a modal sheet over the current content.object
required
fullScreenCover
Presents a full-screen modal cover over the current content.object
required
Configuration for the full-screen cover presentation.
Unlike sheet, a full-screen cover takes over the entire screen and does not show a drag indicator. The user cannot dismiss it by swiping down — provide an explicit dismiss action (e.g., a button that sets
isPresented to false).presentationDetents
Sets the available sheet size detents (snap points) for a presented sheet.PresentationDetents
required
An array of detent configurations that define the available sheet heights. Each detent is a
PresentationDetent object with a detentType property.Use the Detent convenience constructors:Detent.medium— half-screen heightDetent.large— full-screen heightDetent.fraction(value)— fraction of screen height (0 to 1)Detent.height(value)— exact height in points
Apply
.presentationDetents() to the same component that has the .sheet() modifier. When multiple detents are provided, the user can drag between them. If only one detent is provided, the sheet snaps to that height and cannot be resized.quickLookPreview
Presents a Quick Look preview for a file URL.object
required
Quick Look supports many file types including images, PDFs, 3D models, and documents. The preview is presented modally and dismissed by the user or by setting the URL to
null.See also
- Navigation chrome — push views onto a navigation stack
- Toolbar — add toolbar items to presented content
- NavigationStack — navigation container