<!--
{
  "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/focusable(_:interactions:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE9focusable_12interactionsQrSb_AA17FocusInteractionsVtF"
  },
  "title" : "focusable(_:interactions:)"
}
-->

# focusable(_:interactions:)

Specifies if the view is focusable, and if so, what focus-driven
interactions it supports.

```
nonisolated func focusable(_ isFocusable: Bool = true, interactions: FocusInteractions) -> some View
```

## Parameters

`isFocusable`

`true` if the view should participate in focus;
`false` otherwise. The default value is `true`.

`interactions`

The types of focus interactions supported by the view.
The default value is `.automatic`.

## Return Value

A view that sets whether its child is focusable.

## Discussion

By default, SwiftUI enables all possible focus interactions. However, on
macOS and iOS it is conventional for button-like views to only accept
focus when the user has enabled keyboard navigation system-wide in the
Settings app. Clients can reproduce this behavior with custom views by
only supporting `.activate` interactions.

```
MyTapGestureView(...)
    .focusable(interactions: .activate)
```

> Note: The focus interactions allowed for custom views changed in
> macOS 14—previously, custom views could only become focused with
> keyboard navigation enabled system-wide. Clients built using older
> SDKs will continue to see the older focus behavior, while custom views
> in clients built using macOS 14 or later will always be focusable
> unless the client requests otherwise by specifying a restricted set of
> focus interactions.

---

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)