---
title: "minSize(width:height:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/uihostingconfiguration/minsize(width:height:)"
---

# minSize(width:height:)

Sets the minimum size for the configuration.

## Declaration

```swift
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

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)

## See Also

### Setting a size

- [minSize()](swiftui/uihostingconfiguration/minsize().md)
