Google is committed to advancing racial equity for Black communities. See how.

Interaction

interface Interaction
androidx.compose.foundation.Interaction

An Interaction represents transient UI state for a component, typically separate from the actual 'business' state that a component may control. For example, a button typically fires an onClick callback when the button is pressed and released, but it will still want to show that it is being pressed before this callback is fired. This transient state is represented by an Interaction, in this case Pressed. Using Interactions allows you to build components that respond to these transient, component-owned state changes.

The current interactions present on a given component are typically represented with an InteractionState. See InteractionState for more information on consuming Interactions, and associated sample usage.

Summary

Nested classes

An interaction corresponding to a dragged state on a component.

An interaction corresponding to a pressed state on a component.