<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/CustomHoverEffect/hoverEffectDisabled(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI17CustomHoverEffectPAAE05hoverE8DisabledyQrSbF"
  },
  "title" : "hoverEffectDisabled(_:)"
}
-->

# hoverEffectDisabled(_:)

Disables this hover effect.

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

A conditionally disabled hover effect.

## 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)
        }
    }
}
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)