<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/UIHostingConfiguration/minSize(width:height:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI22UIHostingConfigurationV7minSize5width6heightACyxq_G14CoreFoundation7CGFloatVSg_AKtF"
  },
  "title" : "minSize(width:height:)"
}
-->

# minSize(width:height:)

Sets the minimum size for the configuration.

```
func minSize(width: CGFloat? = nil, height: CGFloat? = nil) -> UIHostingConfiguration<Content, Background>
```

## Parameters

`width`

The value to use for the width dimension. A value of
`nil` indicates that the system default should be used.

`height`

The value to use for the height dimension. A value
of `nil` indicates that the system default should be used.

## Discussion

Use this modifier to indicate that a configuration’s associated cell can
be resized to a specific minimum. The following example allows the cell
to be compressed to zero size:

```
UIHostingConfiguration {
    Text("My Contents")
}
.minSize(width: 0, height: 0)
```

---

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)