---
title: "focusTarget"
description: "Add this modifier to a component to make it focusable.

Focus state is stored within this modifier. The bounds of this modifier reflect the bounds of the
focus box.

Note: This is a low level modifier. Before using this consider using
[Modifier.focusable()][androidx.compose.foundation.focusable]. It uses a [focusTarget] in its
implementation. [Modifier.focusable()][androidx.compose.foundation.focusable] adds semantics that
are needed for accessibility."
type: "modifier"
---

<div class='type'>Compose Modifier</div>

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


```kotlin
fun Modifier.focusTarget(): Modifier
```


Add this modifier to a component to make it focusable.

Focus state is stored within this modifier. The bounds of this modifier reflect the bounds of the
focus box.

Note: This is a low level modifier. Before using this consider using
`Modifier.focusable()`. It uses a `focusTarget` in its
implementation. `Modifier.focusable()` adds semantics that
are needed for accessibility.



## Code Examples
### FocusableSampleUsingLowerLevelFocusTarget
```kotlin
@Composable
fun FocusableSampleUsingLowerLevelFocusTarget() {
    var color by remember { mutableStateOf(Black) }
    Box(
        Modifier.border(2.dp, color)
            // The onFocusChanged should be added BEFORE the focusTarget that is being observed.
            .onFocusChanged { color = if (it.isFocused) Green else Black }
            .focusTarget()
    )
}
```

