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