<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/hoverEffect(_:in:isEnabled:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE11hoverEffect_2in9isEnabledQrqd___AA05HoverE5GroupVSgSbtAA06CustomiE0Rd__lF"
  },
  "title" : "hoverEffect(_:in:isEnabled:)"
}
-->

# hoverEffect(_:in:isEnabled:)

Applies a hover effect to this view, optionally adding it to a
[`HoverEffectGroup`](/documentation/SwiftUI/HoverEffectGroup).

```
nonisolated func hoverEffect(_ effect: some CustomHoverEffect, in group: HoverEffectGroup?, isEnabled: Bool = true) -> some View
```

## Parameters

`effect`

The effect to apply to this view.

`group`

An optional `HoverEffectGroup` the effect should belong to.

`isEnabled`

Whether this effect is enabled or not.

## Return Value

A new view that applies the hover effect to `self` whenever
the view is hovered, or the [`HoverEffectGroup`](/documentation/SwiftUI/HoverEffectGroup) is activated.

---

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)