---
title: "hoverEffectDisabled(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/customhovereffect/hovereffectdisabled(_:)"
---

# hoverEffectDisabled(_:)

Disables this hover effect.

## Declaration

```swift
func hoverEffectDisabled(_ isDisabled: Bool = true) -> some CustomHoverEffect

```

## Parameters

- `isDisabled`: A Boolean value that determines whether the hover effect is disabled or not. Specifying true takes precedence over false. Default: true.

## Return Value

Return Value A conditionally disabled hover effect.

## Discussion

Discussion Use hoverEffectDisabled(_:) to prevent a hover effect from becoming active. When an effect is disabled, all contained effects are also disabled and cannot be re-enabled. In the following example, the scale effect is disabled if the accessibilityReduceMotion setting is enabled: struct ScaleAndFadeEffect: CustomHoverEffect {     @Environment(\.accessibilityReduceMotion) var accessibilityReduceMotion     func body(content: Content) -> some CustomHoverEffect {         content.hoverEffect { effect, isActive, _ in             effect.scaleEffect(!isActive ? 0.95 : 1.05)         }         .hoverEffectDisabled(accessibilityReduceMotion)         .hoverEffect { effect, isActive, _ in             effect.opacity(!isActive ? 0.9 : 1)         }     } }

## See Also

### Creating custom hover effects

- [hoverEffect(_:in:isEnabled:)](swiftui/customhovereffect/hovereffect(_:in:isenabled:).md)
- [hoverEffect(in:isEnabled:body:)](swiftui/customhovereffect/hovereffect(in:isenabled:body:)-swift.method.md)
- [hoverEffectGroup(_:)](swiftui/customhovereffect/hovereffectgroup(_:)-swift.method.md)
- [hoverEffectGroup(id:in:behavior:)](swiftui/customhovereffect/hovereffectgroup(id:in:behavior:)-swift.method.md)
