---
title: "FocusTargetModifierNode"
description: "Create a [FocusTargetModifierNode] that can be delegated to in order to create a modifier that
makes a component focusable. Use a different instance of [FocusTargetModifierNode] for each
focusable component."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


> **Deprecated** Use the other overload with added parameters for focusability and onFocusChange

```kotlin
@JsName("funFocusTargetModifierNode")
fun FocusTargetModifierNode(): FocusTargetModifierNode
```


Create a `FocusTargetModifierNode` that can be delegated to in order to create a modifier that
makes a component focusable. Use a different instance of `FocusTargetModifierNode` for each
focusable component.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
@JsName("funFocusTargetModifierNode2")
fun FocusTargetModifierNode(
    focusability: Focusability = Focusability.Always,
    onFocusChange: ((previous: FocusState, current: FocusState) -> Unit)? = null,
): FocusTargetModifierNode
```


Create a `FocusTargetModifierNode` that can be delegated to in order to create a modifier that
makes a component focusable. Use a different instance of `FocusTargetModifierNode` for each
focusable component.

#### Parameters

| | |
| --- | --- |
| focusability | the `Focusability` that configures focusability for this node |
| onFocusChange | a callback invoked when the `FocusTargetModifierNode.focusState` changes, providing the previous state that it changed from, and the current focus state. Note that this will be invoked if the node is losing focus due to being detached from the hierarchy, but before the node is marked as detached (node.isAttached will still be true). |




