---
title: "focusedValue(_:_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/focusedvalue(_:_:)"
---

# focusedValue(_:_:)

Modifies this view by injecting a value that you provide for use by other views whose state depends on the focused view hierarchy.

## Declaration

```swift
nonisolated func focusedValue<Value>(_ keyPath: WritableKeyPath<FocusedValues, Value?>, _ value: Value) -> some View

```

## Parameters

- `keyPath`: The key path to associate value with when adding it to the existing table of exported focus values.
- `value`: The focus value to export.

## Return Value

Return Value A modified representation of this view.

## See Also

### Exposing value types to focused views

- [focusedValue(_:)](swiftui/view/focusedvalue(_:).md)
- [focusedSceneValue(_:)](swiftui/view/focusedscenevalue(_:).md)
- [focusedSceneValue(_:_:)](swiftui/view/focusedscenevalue(_:_:).md)
- [FocusedValues](swiftui/focusedvalues.md)
