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
Support
Usage
Medium and large detents
Custom fraction detent
Fixed height detent
Notes
- 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.