Skip to main content
visualEffect applies geometry-driven transforms — opacity, offset, scale, blur, rotation — that update as a component’s position or size changes, ideal for parallax and scroll-driven UI. coordinateSpace registers a named frame of reference that visualEffect and GeometryReader can resolve positions against. Effects applied through visualEffect are purely visual and do not affect layout. Pair coordinateSpace on a ScrollView with visualEffect on its descendants to drive effects from scroll position.

visualEffect

Applies geometry-aware visual effects using a builder pattern.
(builder: VisualEffectBuilder, proxy: GeometryProxy) => VisualEffectBuilder
required
A function that receives a VisualEffectBuilder and a GeometryProxy, and returns the builder with effects chained onto it. The proxy provides layout information (size, position, safe area insets) that can drive the effect values.
Scroll-driven opacity Fade a component based on its position within a scroll view.
Parallax effect
Scale and blur on scroll
Size-based rotation
The callback is re-evaluated whenever the component’s geometry changes (e.g., during scrolling or resizing). Effects applied through the builder do not affect the component’s layout — they are purely visual transforms. Use coordinateSpace on a parent to create named coordinate spaces that can be referenced in proxy.frame().

coordinateSpace

Assigns a named coordinate space to a component for geometry calculations.
string
required
A unique name for this coordinate space. Other components can reference this name in GeometryProxy.frame() to get their position relative to this component.
Named scroll view coordinate space
Track position relative to a container

See also

  • offset — translate a component without affecting layout
  • scaleEffect — static scaling without geometry feedback
  • rotationEffect — static rotation
  • blur — apply a Gaussian blur
  • opacity — set transparency