# collectIsFocusedAsState

Common/All

## Functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html>` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/InteractionSource.https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/collectIsFocusedAsState.composable#(androidx.compose.foundation.interaction.InteractionSource).collectIsFocusedAsState()()` Subscribes to this `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource` and returns a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State` representing whether this component is focused or not. | Cmn |

## Functions

### InteractionSource.collectIsFocusedAsState

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/interaction/FocusInteraction.kt+function:collectIsFocusedAsState) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)

```
@Composable
fun InteractionSource.collectIsFocusedAsState(): State<Boolean>
```

Subscribes to this `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource` and returns a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State` representing whether this component is focused or not.

`https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/FocusInteraction` is typically set by `https://developer.android.com/reference/kotlin/androidx/compose/foundation/focusable.modifier#(androidx.compose.ui.Modifier).focusable(kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource)` and focusable components, such as `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/BasicTextField.composable#BasicTextField(androidx.compose.foundation.text.input.TextFieldState,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.ui.text.TextStyle,androidx.compose.foundation.text.KeyboardOptions,androidx.compose.foundation.text.input.KeyboardActionHandler,androidx.compose.foundation.text.input.TextFieldLineLimits,kotlin.Function2,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Brush,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.text.input.TextFieldDecorator,androidx.compose.foundation.ScrollState)`.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html>` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State` representing whether this component is being focused or not |