<!--
{
  "availability" : [
    "iOS: 16.4.0 -",
    "iPadOS: 16.4.0 -",
    "macCatalyst: 16.4.0 -",
    "macOS: 13.3.0 -",
    "tvOS: 16.4.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/presentationCompactAdaptation(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE29presentationCompactAdaptationyQrAA012PresentationF0VF"
  },
  "title" : "presentationCompactAdaptation(_:)"
}
-->

# presentationCompactAdaptation(_:)

Specifies how to adapt a presentation to compact size classes.

```
nonisolated func presentationCompactAdaptation(_ adaptation: PresentationAdaptation) -> some View
```

## Parameters

`adaptation`

The adaptation to use in either a horizontally
or vertically compact size class.

## Discussion

Some presentations adapt their appearance depending on the context. For
example, a sheet presentation over a vertically-compact view uses a
full-screen-cover appearance by default. Use this modifier to indicate
a custom adaptation preference. For example, the following code
uses a presentation adaptation value of [`none`](/documentation/SwiftUI/PresentationAdaptation/none)
to request that the system not adapt the sheet in compact size classes:

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

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

If you want to specify different adaptations for each dimension,
use the [`presentationCompactAdaptation(horizontal:vertical:)`](/documentation/SwiftUI/View/presentationCompactAdaptation(horizontal:vertical:))
method instead.

---

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)