<div class='type'>Interface</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>



```kotlin
interface MutableInteractionSource : InteractionSource
```


MutableInteractionSource represents a stream of `Interaction`s corresponding to events emitted by
a component. These `Interaction`s can be used to change how components appear in different
states, such as when a component is pressed or dragged.

Lower level interaction APIs such as `androidx.compose.foundation.clickable` and
`androidx.compose.foundation.gestures.draggable` have an `MutableInteractionSource` parameter,
which allows you to hoist an `MutableInteractionSource` and combine multiple interactions into
one event stream.

MutableInteractionSource exposes `emit` and `tryEmit` functions. These emit the provided
`Interaction` to the underlying `interactions` `Flow`, allowing consumers to react to these new
`Interaction`s.

An instance of MutableInteractionSource can be created by using the `MutableInteractionSource`
factory function. This instance should be `remember`ed before it is passed to other components
that consume it.


## Functions



<h2 id="emit-interaction">emit</h2>

```kotlin
suspend fun emit(interaction: Interaction)
```


Emits `interaction` into `interactions`. This method is not thread-safe and should not be
invoked concurrently.




<hr class="docs-overload-divider">


<h2 id="tryemit-interaction">tryEmit</h2>

```kotlin
fun tryEmit(interaction: Interaction): Boolean
```


Tries to emit `interaction` into `interactions` without suspending. It returns `true` if the
value was emitted successfully.