---
title: "defaultSize(width:height:depth:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/scene/defaultsize(width:height:depth:)"
---

# defaultSize(width:height:depth:)

Sets a default size for a volumetric window.

## Declaration

```swift
nonisolated func defaultSize(width: CGFloat, height: CGFloat, depth: CGFloat) -> some Scene

```

## Parameters

- `width`: The default width for the created window.
- `height`: The default height for the created window.
- `depth`: The default depth for the created volumetric window.

## Return Value

Return Value A scene that uses a default size for new windows.

## Discussion

Discussion Use this modifier to indicate the default initial size for a new 3D window created from a Scene using VolumetricWindowStyle: WindowGroup {     ContentView() } .windowStyle(.volumetric) .defaultSize(width: 600, height: 400, depth: 600) Each parameter is specified in points. The size of a volumetric scene is immutable after creation. This modifier affects only windows that have the volumetric style in visionOS.

## 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(_: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)
- [WindowIdealSize](swiftui/windowidealsize.md)
