---
title: "windowIdealSize(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/scene/windowidealsize(_:)"
---

# windowIdealSize(_:)

Specifies how windows derived form this scene should determine their size when zooming.

## Declaration

```swift
nonisolated func windowIdealSize(_ idealSize: WindowIdealSize) -> some Scene

```

## Parameters

- `idealSize`: A value which determines how windows derived from this scene should size themselves when zooming.

## Discussion

Discussion The default behavior will size the window to its maximum size, or the bounds of the display, whichever is smaller. By overriding this behavior, you can provide a size that is appropriate for the contents of your window. 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)     } }

## 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/windowidealsize.md)
