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

PressInteractionKt

public final class PressInteractionKt


Summary

Public methods

static final @NonNull State<@NonNull Boolean>

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

Public methods

collectIsPressedAsState

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

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

PressInteraction is typically set by androidx.compose.foundation.clickable and clickable higher level components, such as buttons.

Returns
@NonNull State<@NonNull Boolean>

State representing whether this component is being pressed or not