<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/scrollClipDisabled(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE18scrollClipDisabledyQrSbF"
  },
  "title" : "scrollClipDisabled(_:)"
}
-->

# scrollClipDisabled(_:)

Sets whether a scroll view clips its content to its bounds.

```
nonisolated func scrollClipDisabled(_ disabled: Bool = true) -> some View
```

## Parameters

`disabled`

A Boolean value that specifies whether to disable
scroll view clipping.

## Return Value

A view that disables or enables scroll view clipping.

## Discussion

By default, a scroll view clips its content to its bounds, but you can
disable that behavior by using this modifier. For example, if the views
inside the scroll view have shadows that extend beyond the bounds of the
scroll view, you can use this modifier to avoid clipping the shadows:

```
struct ContentView: View {
    var disabled: Bool
    let colors: [Color] = [.red, .green, .blue, .mint, .teal]

    var body: some View {
        ScrollView(.horizontal) {
            HStack(spacing: 20) {
                ForEach(colors, id: \.self) { color in
                    Rectangle()
                        .frame(width: 100, height: 100)
                        .foregroundStyle(color)
                        .shadow(color: .primary, radius: 20)
                }
            }
        }
        .scrollClipDisabled(disabled)
    }
}
```

The scroll view in the above example clips when the
content view’s `disabled` input is `false`, as it does
if you omit the modifier, but not when the input is `true`:

**True:**

![A horizontal row of uniformly sized, evenly spaced, vertically aligned squares inside a bounding box that’s about twice the height of the squares, and almost four times the width. From left to right, three squares appear in full, while only the first quarter of a fourth square appears at the far right. All the squares have shadows that fade away before reaching the top or the bottom of the bounding box.](images/com.apple.SwiftUI/View-scrollClipDisabled-1-iOS@2x.png)

**False:**

![A horizontal row of uniformly sized, evenly spaced, vertically aligned squares inside a bounding box that’s about twice the height of the squares, and almost four times the width. From left to right, three squares appear in full, while only the first quarter of a fourth square appears at the far right. All the squares have shadows that are visible in between squares, but clipped at the top and bottom of the squares.](images/com.apple.SwiftUI/View-scrollClipDisabled-2-iOS@2x.png)

While you might want to avoid clipping parts of views that exceed the
bounds of the scroll view, like the shadows in the above example, you
typically still want the scroll view to clip at some point.
Create custom clipping by using the [`clipShape(_:style:)`](/documentation/SwiftUI/View/clipShape(_:style:))
modifier to add a different clip shape. The following code disables
the default clipping and then adds rectangular clipping that exceeds
the bounds of the scroll view by the default padding amount:

```
ScrollView(.horizontal) {
    // ...
}
.scrollClipDisabled()
.padding()
.clipShape(Rectangle())
```

---

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)