# indication

Common/AllAndroid/JVM

## Functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.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)( interactionSource: https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/InteractionSource, indication: https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication? )` Draws visual effects for this component when interactions occur. | Cmn |

## Functions

### Modifier.indication

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:indication) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)

```
fun Modifier.indication(
    interactionSource: InteractionSource,
    indication: Indication?
): Modifier
```

Draws visual effects for this component when interactions occur.

```kotlin
import androidx.compose.foundation.LocalIndication
import androidx.compose.foundation.clickable
import androidx.compose.foundation.indication
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.requiredHeight
import androidx.compose.material3.Text
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp

val interactionSource = remember { MutableInteractionSource() }
Column {
    Text(
        text = "Click me and my neighbour will indicate as well!",
        modifier =
            Modifier
                // clickable will dispatch events using MutableInteractionSource
                .clickable(
                    interactionSource = interactionSource,
                    indication = LocalIndication.current,
                ) {
                    /** do something */
                }
                .padding(10.dp),
    )
    Spacer(Modifier.requiredHeight(10.dp))
    Text(
        text = "I'm neighbour and I indicate when you click the other one",
        modifier =
            Modifier
                // this element doesn't have a click, but will show default indication from the
                // CompositionLocal as it accepts the same MutableInteractionSource
                .indication(interactionSource, LocalIndication.current)
                .padding(10.dp),
    )
}
```

| Parameters |
|---|---|
| `interactionSource: https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/InteractionSource` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/InteractionSource` that will be used 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)` to draw visual effects - this `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/InteractionSource` represents the stream of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction`s for this component. |
| `indication: https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication?` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication` used to draw visual effects. If `null`, no visual effects will be shown for this component. |