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

# scrollDisabled(_:)

Disables or enables scrolling in scrollable views.

```
nonisolated func scrollDisabled(_ disabled: Bool) -> some View
```

## Parameters

`disabled`

A Boolean that indicates whether scrolling is
disabled.

## Discussion

Use this modifier to control whether a [`ScrollView`](/documentation/SwiftUI/ScrollView) can scroll:

```
@State private var isScrollDisabled = false

var body: some View {
    ScrollView {
        VStack {
            Toggle("Disable", isOn: $isScrollDisabled)
            MyContent()
        }
    }
    .scrollDisabled(isScrollDisabled)
}
```

SwiftUI passes the disabled property through the environment, which
means you can use this modifier to disable scrolling for all scroll
views within a view hierarchy. In the following example, the modifier
affects both scroll views:

```
 ScrollView {
     ForEach(rows) { row in
         ScrollView(.horizontal) {
             RowContent(row)
         }
     }
 }
 .scrollDisabled(true)
```

You can also use this modifier to disable scrolling for other kinds
of scrollable views, like a [`List`](/documentation/SwiftUI/List) or a [`TextEditor`](/documentation/SwiftUI/TextEditor).

---

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)