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

# scrollTransition(_: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(_ configuration: ScrollTransitionConfiguration = .interactive, axis: Axis? = nil, transition: @escaping @Sendable (EmptyVisualEffect, ScrollTransitionPhase) -> some VisualEffect) -> some View
```

## Parameters

`configuration`

The configuration controlling how the
transition will be applied. The configuration will be applied both
while the view is coming into view and while it is disappearing (the
transition is symmetrical).

`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`

A closure that applies visual effects as a function of
the provided phase.

---

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)