<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/FocusState/projectedValue",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI10FocusStateV14projectedValueAC7BindingVyx_Gvp"
  },
  "title" : "projectedValue"
}
-->

# projectedValue

A projection of the focus state value that returns a binding.

```
var projectedValue: FocusState<Value>.Binding { get }
```

## Discussion

When focus is outside any view that is bound to this state, the wrapped
value is `nil` for optional-typed state or `false` for Boolean state.

In the following example of a simple navigation sidebar, when the user
presses the Filter Sidebar Contents button, focus moves to the sidebar’s
filter text field. Conversely, if the user moves focus to the sidebar’s
filter manually, then the value of `isFiltering` automatically
becomes `true`, and the sidebar view updates.

```
struct Sidebar: View {
    @State private var filterText = ""
    @FocusState private var isFiltering: Bool

    var body: some View {
        VStack {
            Button("Filter Sidebar Contents") {
                isFiltering = true
            }

            TextField("Filter", text: $filterText)
                .focused($isFiltering)
        }
    }
}
```

---

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)