{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

FocusInteractionKt

public final class FocusInteractionKt


Summary

Public methods

static final @NonNull State<@NonNull Boolean>

Subscribes to this MutableInteractionSource and returns a State representing whether this component is focused or not.

Public methods

collectIsFocusedAsState

@Composable
public static final @NonNull State<@NonNull BooleancollectIsFocusedAsState(@NonNull InteractionSource receiver)

Subscribes to this MutableInteractionSource and returns a State representing whether this component is focused or not.

FocusInteraction is typically set by androidx.compose.foundation.focusable and focusable components, such as androidx.compose.foundation.text.BasicTextField.

Returns
@NonNull State<@NonNull Boolean>

State representing whether this component is being focused or not