<!--
{
  "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/ContentMode/fit",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI11ContentModeO3fityA2CmF"
  },
  "title" : "ContentMode.fit"
}
-->

# ContentMode.fit

An option that resizes the content so it’s all within the available space,
both vertically and horizontally.

```
case fit
```

## Discussion

This mode preserves the content’s aspect ratio.
If the content doesn’t have the same aspect ratio as the available
space, the content becomes the same size as the available space on
one axis and leaves empty space on the other.

---

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)