<!--
{
  "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/scrollTransition(topLeading:bottomTrailing:axis:transition:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE16scrollTransition10topLeading14bottomTrailing4axis10transitionQrAA06ScrollE13ConfigurationV_AjA4AxisOSgqd__AA17EmptyVisualEffectV_AA0lE5PhaseOtYbctAA0pQ0Rd__lF"
  },
  "title" : "scrollTransition(topLeading:bottomTrailing:axis:transition:)"
}
-->

# scrollTransition(topLeading:bottomTrailing:axis:transition:)

Applies the given transition, animating between the phases
of the transition as this view appears and disappears within the
visible region of the containing scroll view.

```
nonisolated func scrollTransition(topLeading: ScrollTransitionConfiguration, bottomTrailing: ScrollTransitionConfiguration, axis: Axis? = nil, transition: @escaping @Sendable (EmptyVisualEffect, ScrollTransitionPhase) -> some VisualEffect) -> some View
```

## Parameters

`topLeading`

The configuration that drives the transition when
the view is about to appear at the top edge of a vertical
scroll view, or the leading edge of a horizont scroll view.

`bottomTrailing`

The configuration that drives the transition when
the view is about to appear at the bottom edge of a vertical
scroll view, or the trailing edge of a horizont scroll view.

`axis`

The axis of the containing scroll view over which the
transition will be applied. The default value of `nil` uses the
axis of the innermost containing scroll view, or `.vertical` if
the innermost scroll view is scrollable along both axes.

`transition`

the transition to apply.

---

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)