<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/focusEffectDisabled(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE19focusEffectDisabledyQrSbF"
  },
  "title" : "focusEffectDisabled(_:)"
}
-->

# focusEffectDisabled(_:)

Adds a condition that controls whether this view can display focus
effects, such as a default focus ring or hover effect.

```
nonisolated func focusEffectDisabled(_ disabled: Bool = true) -> some View
```

## Parameters

`disabled`

A Boolean value that determines whether this view
can display focus effects.

## Return Value

A view that controls whether focus effects can be displayed
in this view.

## Discussion

The higher views in a view hierarchy can override the value you set on
this view. In the following example, the button does not display a focus
effect because the outer `focusEffectDisabled(_:)` modifier overrides
the inner one:

```
HStack {
    Button("Press") {}
        .focusEffectDisabled(false)
}
.focusEffectDisabled(true)
```

---

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)