---
title: WindowIdealSize
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/windowidealsize
---

# WindowIdealSize

A type which defines the size a window should use when zooming.

## Declaration

```swift
struct WindowIdealSize
```

## Overview

Overview Use this type in conjunction with the Scene.windowIdealSize(_:) modifier to override the default behavior for how windows behave when performing a zoom. For example, you can define a window group where the window has an ideal width of 800 points and an ideal height of 600 points: struct MyApp: App {     var body: some Scene {         WindowGroup {             ContentView()                 .frame(idealWidth: 800, idealHeight: 600)         }         .windowIdealSize(.fitToContent)     } }

## Topics

### Type Properties

- [automatic](swiftui/windowidealsize/automatic.md)
- [fitToContent](swiftui/windowidealsize/fittocontent.md)
- [maximum](swiftui/windowidealsize/maximum.md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Sizing a window

- [Positioning and sizing windows](visionos/positioning-and-sizing-windows.md)
- [defaultSize(_:)](swiftui/scene/defaultsize(_:).md)
- [defaultSize(width:height:)](swiftui/scene/defaultsize(width:height:).md)
- [defaultSize(width:height:depth:)](swiftui/scene/defaultsize(width:height:depth:).md)
- [defaultSize(_:in:)](swiftui/scene/defaultsize(_:in:).md)
- [defaultSize(width:height:depth:in:)](swiftui/scene/defaultsize(width:height:depth:in:).md)
- [windowResizability(_:)](swiftui/scene/windowresizability(_:).md)
- [WindowResizability](swiftui/windowresizability.md)
- [windowIdealSize(_:)](swiftui/scene/windowidealsize(_:).md)
