---
title: hoverEffectGroup()
framework: swiftui
role: symbol
role_heading: Instance Method
path: swiftui/view/hovereffectgroup()
---

# hoverEffectGroup()

Adds an implicit HoverEffectGroup to all effects defined on descendant views, so that all effects added to subviews activate as a group whenever this view or any descendant views are hovered.

## Declaration

```swift
nonisolated func hoverEffectGroup() -> some View

```

## Return Value

Return Value A view that activates the given hover group, as well as all effects added to subviews.

## Discussion

Discussion You use this modifier when all effects defined on a view and its subviews should activate together. In the following example hovering anywhere over the view will activate the hoverEffects added to the Text and the background view: struct EffectView: View {     var effectGroup: HoverEffectGroup?

var body: some View {         HStack {             Image(systemName: "exclamationmark.triangle.fill")             Text("12 Issues")                 .hoverEffect { effect, isActive, _ in                     effect.opacity(isActive ? 1 : 0.5)                 }         }         .padding()         .background {             Capsule()                 .fill(.yellow)                 .hoverEffect { effect, isActive, _ in                     effect.opacity(isActive ? 0.25 : 0.1)                 }         }         .hoverEffectGroup()    } }

## See Also

### Changing view appearance for hover events

- [hoverEffect(_:)](swiftui/view/hovereffect(_:).md)
- [HoverEffect](swiftui/hovereffect.md)
- [hoverEffect(_:in:isEnabled:)](swiftui/view/hovereffect(_:in:isenabled:).md)
- [hoverEffect(in:isEnabled:body:)](swiftui/view/hovereffect(in:isenabled:body:).md)
- [CustomHoverEffect](swiftui/customhovereffect.md)
- [ContentHoverEffect](swiftui/contenthovereffect.md)
- [HoverEffectGroup](swiftui/hovereffectgroup.md)
- [hoverEffectGroup(_:)](swiftui/view/hovereffectgroup(_:).md)
- [hoverEffectGroup(id:in:behavior:)](swiftui/view/hovereffectgroup(id:in:behavior:).md)
- [GroupHoverEffect](swiftui/grouphovereffect.md)
- [HoverEffectContent](swiftui/hovereffectcontent.md)
- [EmptyHoverEffectContent](swiftui/emptyhovereffectcontent.md)
- [handPointerBehavior(_:)](swiftui/view/handpointerbehavior(_:).md)
- [HandPointerBehavior](swiftui/handpointerbehavior.md)
