<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/preferredWindowClippingMargins(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE30preferredWindowClippingMarginsyQrAA6Edge3DO3SetV_14CoreFoundation7CGFloatVSgtF::OverloadGroup"
  },
  "title" : "preferredWindowClippingMargins(_:_:)"
}
-->

# preferredWindowClippingMargins(_:_:)

Requests additional margins for drawing beyond the bounds of the window.

```
@MainActor @preconcurrency func preferredWindowClippingMargins(_ edges: Edge3D.Set = .all, _ length: CGFloat?) -> some View
```

## Parameters

`edges`

The edges that should receive margins.

`length`

The amount of margin requested on each specified edge.

## Discussion

This modifier will only have an effect on windows with a `.volumetric`
window style.

A window’s bounds are based on its content, and resizable by dragging
the corners. By default, the system clips any content that draws
beyond the bounds. This modifier requests additional space for drawing
outside the window’s bounds. Use this space to render extra visual
effects that enhance the impact of your app. This content does not
receive events, and may be clipped by the system at any time.

The additional margins granted by this modifier are not guaranteed, and
the system may update or reduce them. Any time the system updates the
current margins, it will update the `windowClippingMargins` value in
the environment.

If multiple views request margins, the scene’s preferred margins will
be the maximum preferred value for each face. For example, if one view
wants a leading margin of `400` and another view a trailing margin of
`400`, the scene will request both a leading and trailing margin of
`400`. If one view requests a leading margin of `200` and another view
a leading margin of `300`, the scene will request `300`.

---

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)