---
title: CustomHoverEffect
framework: swiftui
role: symbol
role_heading: Protocol
path: swiftui/customhovereffect
---

# CustomHoverEffect

A type that represents how a view should change when a pointer hovers over a view, or when someone looks at the view.

## Declaration

```swift
protocol CustomHoverEffect
```

## Overview

Overview Custom hover effects apply their inactive values when the effect is inactive, and their active values when the effect is active. For example, the following effect causes a view to be partially transparent when inactive, but animate to fully opaque when active: struct FadeInHoverEffect: CustomHoverEffect {     func body(content: Content) -> some CustomHoverEffect {         content.hoverEffect { effect, isActive, proxy in             effect.animation(.easeOut) {                 $0.opacity(isActive ? 1 : 0.5)             }         }     } } This effect can be applied to a view using the hoverEffect(_:) modifier: Color.red     .hoverEffect(FadeInHoverEffect()) Hover effects do not affect a view’s layout, and may be applied to a view out-of-process. Therefore an effect’s current phase may not be visible within your app.

## Topics

### Getting built-in hover effects

- [automatic](swiftui/customhovereffect/automatic.md)
- [empty](swiftui/customhovereffect/empty.md)
- [highlight](swiftui/customhovereffect/highlight.md)
- [lift](swiftui/customhovereffect/lift.md)

### 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)
- [hoverEffectDisabled(_:)](swiftui/customhovereffect/hovereffectdisabled(_:).md)

### Supporting types

- [AutomaticHoverEffect](swiftui/automatichovereffect.md)
- [EmptyHoverEffect](swiftui/emptyhovereffect.md)
- [HighlightHoverEffect](swiftui/highlighthovereffect.md)
- [LiftHoverEffect](swiftui/lifthovereffect.md)

### Associated Types

- [Body](swiftui/customhovereffect/body.md)

### Instance Methods

- [body(content:)](swiftui/customhovereffect/body(content:).md)
- [hoverEffectPhaseOverride(_:)](swiftui/customhovereffect/hovereffectphaseoverride(_:).md)

### Type Aliases

- [CustomHoverEffect.Content](swiftui/customhovereffect/content.md)

### Type Methods

- [hoverEffect(in:isEnabled:body:)](swiftui/customhovereffect/hovereffect(in:isenabled:body:)-swift.type.method.md)
- [hoverEffectGroup(_:)](swiftui/customhovereffect/hovereffectgroup(_:)-swift.type.method.md)
- [hoverEffectGroup(id:in:behavior:)](swiftui/customhovereffect/hovereffectgroup(id:in:behavior:)-swift.type.method.md)
- [ornament(attachmentAnchor:contentAlignment:ornament:)](swiftui/customhovereffect/ornament(attachmentanchor:contentalignment:ornament:).md)
- [ornament(attachmentAnchor:contentAlignment:ornament:effect:)](swiftui/customhovereffect/ornament(attachmentanchor:contentalignment:ornament:effect:).md)

## Relationships

### Conforming Types

- [AutomaticHoverEffect](swiftui/automatichovereffect.md)
- [ContentHoverEffect](swiftui/contenthovereffect.md)
- [EmptyHoverEffect](swiftui/emptyhovereffect.md)
- [GroupHoverEffect](swiftui/grouphovereffect.md)
- [HighlightHoverEffect](swiftui/highlighthovereffect.md)
- [HoverEffect](swiftui/hovereffect.md)
- [LiftHoverEffect](swiftui/lifthovereffect.md)
- [ModifiedContent](swiftui/modifiedcontent.md)
- [OrnamentHoverContentEffect](swiftui/ornamenthovercontenteffect.md)
- [OrnamentHoverEffect](swiftui/ornamenthovereffect.md)

## 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)
- [ContentHoverEffect](swiftui/contenthovereffect.md)
- [HoverEffectGroup](swiftui/hovereffectgroup.md)
- [hoverEffectGroup()](swiftui/view/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)
