---
title: "hoverEffect(_:isEnabled:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/hovereffect(_:isenabled:)"
---

# hoverEffect(_:isEnabled:)

Applies a hover effect to this view.

## Declaration

```swift
nonisolated func hoverEffect(_ effect: HoverEffect = .automatic, isEnabled: Bool = true) -> some View

```

## Parameters

- `effect`: The effect to apply to this view.
- `isEnabled`: Whether the effect is enabled or not.

## Return Value

Return Value A new view that applies a hover effect to self.

## Discussion

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

## See Also

### Responding to hover events

- [onHover(perform:)](swiftui/view/onhover(perform:).md)
- [onContinuousHover(coordinateSpace:perform:)](swiftui/view/oncontinuoushover(coordinatespace:perform:).md)
- [hoverEffectDisabled(_:)](swiftui/view/hovereffectdisabled(_:).md)
- [defaultHoverEffect(_:)](swiftui/view/defaulthovereffect(_:).md)
- [isHoverEffectEnabled](swiftui/environmentvalues/ishovereffectenabled.md)
- [HoverPhase](swiftui/hoverphase.md)
- [HoverEffectPhaseOverride](swiftui/hovereffectphaseoverride.md)
- [OrnamentHoverContentEffect](swiftui/ornamenthovercontenteffect.md)
- [OrnamentHoverEffect](swiftui/ornamenthovereffect.md)
