hoverEffect

Applies a hover effect to this view.

View ModifieriOS 13.4+tvOS 16.0+visionOS 1.0+

Overloads

3 ways to call compose().hoverEffect(). Each is one SwiftUI overload, picked by the arguments you pass.

React
compose().hoverEffect(effect?: SwiftUI.HoverEffect)
Swift
nonisolated func hoverEffect(
    _ effect: HoverEffect = .automatic
) -> some View

Parameters

Return value

A new view that applies a hover effect to self.

Discussion

By default, HoverEffect.automatic is used. You can control the behavior of the automatic effect with the View.defaultHoverEffect(_:) modifier.

See also

More in Gestures and input.