# Indication

Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/Indication.kt+class:androidx.compose.foundation.Indication) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  interface Indication
  ```
Known direct subclasses [IndicationNodeFactory](https://developer.android.com/reference/kotlin/androidx/compose/foundation/IndicationNodeFactory)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/IndicationNodeFactory` | IndicationNodeFactory is an Indication that creates `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Node` instances to render visual effects that occur when certain interactions happens. |

*** ** * ** ***

Indication represents visual effects that occur when certain interactions happens. For example: showing a ripple effect when a component is pressed, or a highlight when a component is focused.

To implement your own Indication, see `https://developer.android.com/reference/kotlin/androidx/compose/foundation/IndicationNodeFactory` - an optimized `https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication` that allows for more efficient implementations than the deprecated `https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication#rememberUpdatedInstance(androidx.compose.foundation.interaction.InteractionSource)`.

Indication is typically provided throughout the hierarchy through `https://developer.android.com/reference/kotlin/androidx/compose/foundation/package-summary#LocalIndication()` - you can provide a custom Indication to `https://developer.android.com/reference/kotlin/androidx/compose/foundation/package-summary#LocalIndication()` to change the default `https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication` used for components such as `https://developer.android.com/reference/kotlin/androidx/compose/foundation/clickable.modifier#(androidx.compose.ui.Modifier).clickable(kotlin.Boolean,kotlin.String,androidx.compose.ui.semantics.Role,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0)`.

## Summary

| ### Public functions |
|---|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/compose/foundation/IndicationInstance` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable [rememberUpdatedInstance](https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication#rememberUpdatedInstance(androidx.compose.foundation.interaction.InteractionSource))(interactionSource: https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/InteractionSource)` **This function is deprecated.** rememberUpdatedInstance has been deprecated - implementers should instead implement IndicationNodeFactory#create for improved performance and efficiency. | Cmn |

## Public functions

### rememberUpdatedInstance

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0) Deprecated in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0)

```
@Composable
open fun [rememberUpdatedInstance](https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication#rememberUpdatedInstance(androidx.compose.foundation.interaction.InteractionSource))(interactionSource: InteractionSource): IndicationInstance
```

> [!CAUTION]
> **This function is deprecated.**   
> rememberUpdatedInstance has been deprecated - implementers should instead implement IndicationNodeFactory#create for improved performance and efficiency. Callers should check if the Indication is an IndicationNodeFactory, and call that API instead. For a migration guide and background information, please visit developer.android.com

`https://developer.android.com/reference/kotlin/androidx/compose/runtime/remember.composable#remember(kotlin.Function0)`s a new `https://developer.android.com/reference/kotlin/androidx/compose/foundation/IndicationInstance`, and updates its state based on `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction`s emitted via `https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication#rememberUpdatedInstance(androidx.compose.foundation.interaction.InteractionSource)` . Typically this will be called by `https://developer.android.com/reference/kotlin/androidx/compose/foundation/indication.modifier#(androidx.compose.ui.Modifier).indication(androidx.compose.foundation.interaction.InteractionSource,androidx.compose.foundation.Indication)`, so one `https://developer.android.com/reference/kotlin/androidx/compose/foundation/IndicationInstance` will be used for one component that draws `https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication`, such as a button.

Implementations of this function should observe `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction`s using `https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication#rememberUpdatedInstance(androidx.compose.foundation.interaction.InteractionSource)`, using them to launch animations / state changes inside `https://developer.android.com/reference/kotlin/androidx/compose/foundation/IndicationInstance` that will then be reflected inside `https://developer.android.com/reference/kotlin/androidx/compose/foundation/IndicationInstance#(androidx.compose.ui.graphics.drawscope.ContentDrawScope).drawIndication()`.

| Parameters |
|---|---|
| `interactionSource: https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/InteractionSource` | the `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/InteractionSource` representing the stream of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction`s the returned `https://developer.android.com/reference/kotlin/androidx/compose/foundation/IndicationInstance` should represent |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/IndicationInstance` | an `https://developer.android.com/reference/kotlin/androidx/compose/foundation/IndicationInstance` that represents the stream of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction`s emitted by `https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication#rememberUpdatedInstance(androidx.compose.foundation.interaction.InteractionSource)` |