# androidx.compose.material.ripple

Common/All

## Interfaces

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleTheme` | **This interface is deprecated.** RippleTheme and LocalRippleTheme have been deprecated - they are not compatible with the new ripple implementation using the new Indication APIs that provide notable performance improvements. | Cmn |

## Classes

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha` | RippleAlpha defines the alpha of the ripple / state layer for different `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction`s. | Cmn |

## Composables

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/rememberRipple.composable` | Creates and `https://developer.android.com/reference/kotlin/androidx/compose/runtime/remember.composable#remember(kotlin.Function0)`s a Ripple using values provided by `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleTheme`. | Cmn |

## Top-level functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/node/DelegatableNode` | `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/package-summary#createRippleModifierNode(androidx.compose.foundation.interaction.InteractionSource,kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.ColorProducer,kotlin.Function0)( interactionSource: https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/InteractionSource, bounded: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, radius: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorProducer, rippleAlpha: () -> https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha )` Creates a Ripple node using the values provided. | Cmn |

## Top-level properties summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ProvidableCompositionLocal<https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleTheme>` | `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/package-summary#LocalRippleTheme()` **This property is deprecated.** RippleTheme and LocalRippleTheme have been deprecated - they are not compatible with the new ripple implementation using the new Indication APIs that provide notable performance improvements. | Cmn |

## Top-level functions

### createRippleModifierNode

Cmn Artifact: [androidx.compose.material:material-ripple](https://developer.android.com/jetpack/androidx/releases/compose-material) [View Source](https://cs.android.com/search?q=file:androidx/compose/material/ripple/Ripple.kt+function:createRippleModifierNode) Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.10.0)

```
fun createRippleModifierNode(
    interactionSource: InteractionSource,
    bounded: Boolean,
    radius: Dp,
    color: ColorProducer,
    rippleAlpha: () -> RippleAlpha
): DelegatableNode
```

Creates a Ripple node using the values provided.

A Ripple is a Material implementation of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication` that expresses different `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction`s by drawing ripple animations and state layers.

A Ripple responds to `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/PressInteraction.Press` by starting a new `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAnimation`, and responds to other `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction`s by showing a fixed `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/StateLayer` with varying alpha values depending on the `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction`.

This Ripple node is a low level building block for building IndicationNodeFactory implementations that use a Ripple - higher level design system libraries such as material and material3 provide `https://developer.android.com/reference/kotlin/androidx/compose/foundation/Indication` implementations using this node internally. In most cases you should use those factories directly: this node exists for design system libraries to delegate their Ripple implementation to, after querying any required theme values for customizing the Ripple.

NOTE: when using this factory with `https://developer.android.com/reference/kotlin/androidx/compose/ui/node/DelegatingNode#delegate(androidx.compose.ui.node.DelegatableNode)`, ensure that the node is created once or `https://developer.android.com/reference/kotlin/androidx/compose/ui/node/DelegatingNode#undelegate(androidx.compose.ui.node.DelegatableNode)` is called in `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Node#onDetach()`. Repeatedly delegating to a new node returned by this method in `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Node#onAttach()` without removing the old one will result in multiple ripple nodes being attached to the node.

| 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` used to determine the state of the ripple. |
| `bounded: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | if true, ripples are clipped by the bounds of the target layout. Unbounded ripples always animate from the target layout center, bounded ripples animate from the touch position. |
| `radius: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | the radius for the ripple. If `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp#Unspecified()` is provided then the size will be calculated based on the target layout size. |
| `color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorProducer` | the color of the ripple. This color is usually the same color used by the text or iconography in the component. This color will then have `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/package-summary#createRippleModifierNode(androidx.compose.foundation.interaction.InteractionSource,kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.ColorProducer,kotlin.Function0)` applied to calculate the final color used to draw the ripple. |
| `rippleAlpha: () -> https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha` | the `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha` that will be applied to the `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/package-summary#createRippleModifierNode(androidx.compose.foundation.interaction.InteractionSource,kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.ColorProducer,kotlin.Function0)` depending on the state of the ripple. |

## Top-level properties

### LocalRippleTheme

Cmn Artifact: [androidx.compose.material:material-ripple](https://developer.android.com/jetpack/androidx/releases/compose-material) [View Source](https://cs.android.com/search?q=file:androidx/compose/material/ripple/RippleTheme.kt+symbol:LocalRippleTheme) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0) Deprecated in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.7.0)

```
val LocalRippleTheme: ProvidableCompositionLocal<RippleTheme>
```

> [!CAUTION]
> **This property is deprecated.**   
> RippleTheme and LocalRippleTheme have been deprecated - they are not compatible with the new ripple implementation using the new Indication APIs that provide notable performance improvements. For a migration guide and background information, please visit developer.android.com

CompositionLocal used for providing `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleTheme` down the tree.

See `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleTheme#defaultRippleColor(androidx.compose.ui.graphics.Color,kotlin.Boolean)` and `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleTheme#defaultRippleAlpha(androidx.compose.ui.graphics.Color,kotlin.Boolean)` functions for the default implementations for color and alpha.