<!--
{
  "availability" : [
    "iOS: 13.4.0 -",
    "iPadOS: 13.4.0 -",
    "macCatalyst: 13.4.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/hoverEffect(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE11hoverEffectyQrAA05HoverE0VF"
  },
  "title" : "hoverEffect(_:)"
}
-->

# hoverEffect(_:)

Applies a hover effect to this view.

```
nonisolated func hoverEffect(_ effect: HoverEffect = .automatic) -> some View
```

## Parameters

`effect`

The effect to apply to this view.

## Return Value

A new view that applies a hover effect to `self`.

## Discussion

By default, [`automatic`](/documentation/SwiftUI/HoverEffect/automatic) is used. You can control the
behavior of the automatic effect with the
[`defaultHoverEffect(_:)`](/documentation/SwiftUI/View/defaultHoverEffect(_:)) modifier.

---

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)