Interaction
-
Cmn
interface Interaction
DragInteraction |
An interaction related to drag events. |
FocusInteraction |
An interaction related to focus events. |
HoverInteraction |
An interaction related to hover events. |
PressInteraction |
An interaction related to press events. |
DragInteraction.Cancel |
An interaction representing the cancellation of a |
DragInteraction.Start |
An interaction representing a drag event on a component. |
DragInteraction.Stop |
An interaction representing the stopping of a |
FocusInteraction.Focus |
An interaction representing a focus event on a component. |
FocusInteraction.Unfocus |
An interaction representing a |
HoverInteraction.Enter |
An interaction representing a hover event on a component. |
HoverInteraction.Exit |
An interaction representing a |
PressInteraction.Cancel |
An interaction representing the cancellation of a |
PressInteraction.Press |
An interaction representing a press event on a component. |
PressInteraction.Release |
An interaction representing the release of a |
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 may 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 PressInteraction.Press
. Using Interactions allows you to build components that respond to these transient, component-owned state changes.
To emit / observe current Interactions, see MutableInteractionSource
, which represents a stream of Interactions present for a given component.