<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ScrollView",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI10ScrollViewV"
  },
  "title" : "ScrollView"
}
-->

# ScrollView

A scrollable view.

```
nonisolated struct ScrollView<Content> where Content : View
```

## Overview

The scroll view displays its content within the scrollable content region.
As the user performs platform-appropriate scroll gestures, the scroll view
adjusts what portion of the underlying content is visible. `ScrollView` can
scroll horizontally, vertically, or both, but does not provide zooming
functionality.

In the following example, a `ScrollView` allows the user to scroll through
a [`VStack`](/documentation/SwiftUI/VStack) containing 100 [`Text`](/documentation/SwiftUI/Text) views. The image after the listing
shows the scroll view’s temporarily visible scrollbar at the right; you can
disable it with the `showsIndicators` parameter of the `ScrollView`
initializer.

```
var body: some View {
    ScrollView {
        VStack(alignment: .leading) {
            ForEach(0..<100) {
                Text("Row \($0)")
            }
        }
    }
}
```

![A scroll view with a series of vertically arranged rows, reading](images/com.apple.SwiftUI/SwiftUI-ScrollView-rows-with-indicator@2x.png)

### Controlling Scroll Position

You can influence where a scroll view is initially scrolled
by using the [`defaultScrollAnchor(_:)`](/documentation/SwiftUI/View/defaultScrollAnchor(_:)) view modifier.

Provide a value of [`center`](/documentation/SwiftUI/UnitPoint/center) to have the scroll
view start in the center of its content when a scroll view
is scrollable in both axes.

```
ScrollView([.horizontal, .vertical]) {
    // initially centered content
}
.defaultScrollAnchor(.center)
```

Or provide an alignment of [`bottom`](/documentation/SwiftUI/UnitPoint/bottom) to have the
scroll view start at the bottom of its content when a scroll
view is scrollable in its vertical axes.

```
ScrollView {
    // initially bottom aligned content
}
.defaultScrollAnchor(.bottom)
```

After the scroll view initially renders, the user may scroll
the content of the scroll view.

To perform programmatic scrolling, wrap one or more scroll views with a
[`ScrollViewReader`](/documentation/SwiftUI/ScrollViewReader).

## Topics

### Creating a scroll view

[`init(_:showsIndicators:content:)`](/documentation/SwiftUI/ScrollView/init(_:showsIndicators:content:))

Creates a new instance that’s scrollable in the direction of the given
axis and can show indicators while scrolling.

[`init(_:content:)`](/documentation/SwiftUI/ScrollView/init(_:content:))

Creates a new instance that’s scrollable in the direction of the given
axis and can show indicators while scrolling.

### Configuring a scroll view

[`content`](/documentation/SwiftUI/ScrollView/content)

The scroll view’s content.

[`axes`](/documentation/SwiftUI/ScrollView/axes)

The scrollable axes of the scroll view.

[`showsIndicators`](/documentation/SwiftUI/ScrollView/showsIndicators)

A value that indicates whether the scroll view displays the scrollable
component of the content offset, in a way that’s suitable for the
platform.

### Supporting types

[`body`](/documentation/SwiftUI/ScrollView/body)

The content and behavior of the scroll view.



---

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)