# IndicationInstance

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.IndicationInstance) 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) Common/AllAndroid/JVM
- Cmn

  ```
  interface IndicationInstance
  ```

*** ** * ** ***

> [!CAUTION]
> **This interface is deprecated.**   
> IndicationInstance has been deprecated along with the rememberUpdatedInstance that returns it. Indication implementations should instead use Modifier.Node APIs, and should be returned from IndicationNodeFactory#create. For a migration guide and background information, please visit developer.android.com

IndicationInstance is a specific instance of an `https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication` that draws visual effects on certain interactions, such as press or focus.

IndicationInstances can be stateful or stateless, and are created by `https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication#rememberUpdatedInstance(androidx.compose.foundation.interaction.InteractionSource)` - they should be used in-place and not re-used between different `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)` modifiers.

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/ContentDrawScope.[drawIndication](https://developer.android.com/reference/kotlin/androidx/compose/foundation/IndicationInstance#(androidx.compose.ui.graphics.drawscope.ContentDrawScope).drawIndication())()` **This function is deprecated.** IndicationInstance has been deprecated along with the rememberUpdatedInstance that returns it. | Cmn |

## Public functions

### ContentDrawScope.drawIndication

Cmn 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+function:drawIndication) 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)

```
fun ContentDrawScope.[drawIndication](https://developer.android.com/reference/kotlin/androidx/compose/foundation/IndicationInstance#(androidx.compose.ui.graphics.drawscope.ContentDrawScope).drawIndication())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> IndicationInstance has been deprecated along with the rememberUpdatedInstance that returns it. Indication implementations should instead use Modifier.Node APIs, and should be returned from IndicationNodeFactory#create. For a migration guide and background information, please visit developer.android.com

Draws visual effects for the current interactions present on this component.

Typically this function will read state within this instance that is mutated by `https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication#rememberUpdatedInstance(androidx.compose.foundation.interaction.InteractionSource)`. This allows `https://developer.android.com/reference/kotlin/androidx/compose/foundation/IndicationInstance` to just read state and draw visual effects, and not actually change any state itself.

This method MUST call `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/ContentDrawScope#drawContent()` at some point in order to draw the component itself underneath any indication. Typically this is called at the beginning, so that indication can be drawn as an overlay on top.