# RippleConfiguration

Artifact: [androidx.wear.compose:compose-material3](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/material3/Ripple.kt+class:androidx.wear.compose.material3.RippleConfiguration) Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.6.0)


```
class RippleConfiguration
```

<br />

*** ** * ** ***

Configuration for `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#ripple(kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shape,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)` appearance, provided using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#LocalRippleConfiguration()`. In most cases the default values should be used, for custom design system use cases you should instead build your own custom ripple using `https://developer.android.com/reference/kotlin/androidx/compose/material3/ripple/package-summary#createRippleModifierNode(androidx.compose.foundation.interaction.InteractionSource,kotlin.Function0)`. To disable the ripple, provide `null` using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#LocalRippleConfiguration()`.

The ripple configuration is resolved as follows:

- `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#LocalRippleThemeConfiguration()` provides the highest-level theming configuration for ripples, including whether the focus indication is drawn by inset focus rings.

- `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#LocalRippleConfiguration()` provides hierarchical per-ripple configuration for `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#ripple(kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shape,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)`, including disabling ripples and their indications. This takes next highest priority.

- `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#ripple(kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shape,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)` parameters allow specifying configuration for individual indication callsites in components.

```kotlin
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.unit.dp
import androidx.wear.compose.material3.Button
import androidx.wear.compose.material3.LocalRippleConfiguration
import androidx.wear.compose.material3.LocalRippleThemeConfiguration
import androidx.wear.compose.material3.MaterialTheme
import androidx.wear.compose.material3.RippleConfiguration
import androidx.wear.compose.material3.RippleThemeConfiguration
import androidx.wear.compose.material3.SwitchButton
import androidx.wear.compose.material3.Text

// Customize the focus ring stroke sizes through the theme configuration.
CompositionLocalProvider(
    LocalRippleThemeConfiguration provides
        RippleThemeConfiguration(
            RippleThemeConfiguration.Focus.InsetRing(
                outerStrokeInset = 0.dp,
                outerStrokeWidth = 3.dp,
                innerStrokeInset = 0.dp,
                innerStrokeWidth = 6.dp,
            )
        )
) {
    Column(
        modifier = Modifier.fillMaxSize(),
        verticalArrangement = Arrangement.spacedBy(4.dp, Alignment.CenterVertically),
        horizontalAlignment = Alignment.CenterHorizontally,
    ) {
        // Button is a standard Wear Material3 component that supports focus rings internally.
        Button(onClick = { /* Do something */ }, label = { Text("Button") })

        // SwitchButton is also a standard component that supports focus rings internally.
        // We override its focus ring colors here.
        CompositionLocalProvider(
            LocalRippleConfiguration provides
                RippleConfiguration(
                    focus =
                        RippleConfiguration.Focus.InsetRing(
                            outerStrokeColor = MaterialTheme.colorScheme.tertiary,
                            innerStrokeColor = MaterialTheme.colorScheme.onTertiary,
                        )
                )
        ) {
            SwitchButton(
                checked = true,
                onCheckedChange = { /* Do something */ },
                label = { Text("SwitchButton") },
            )
        }
    }
}
```

## Summary

| ### Nested types |
|---|
| `sealed class https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration.Focus` The configuration options for the focus indication for `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration`. |
| `class https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration.Focus.InsetRing : https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration.Focus` An inset ring focus indication. |
| `object https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration.Focus.Opacity : https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration.Focus` An opacity-based focus indication. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration#RippleConfiguration(androidx.compose.ui.graphics.Color)(color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color)` Configuration for `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#ripple(kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shape,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)` appearance, provided using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#LocalRippleConfiguration()`. |
| `[RippleConfiguration](https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration#RippleConfiguration(androidx.compose.ui.graphics.Color,androidx.compose.material.ripple.RippleAlpha))(color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, rippleAlpha: https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha?)` **This function is deprecated.** Use other configuration options in RippleThemeConfiguration, RippleConfiguration and ripple. |
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration#RippleConfiguration(androidx.wear.compose.material3.RippleConfiguration.Focus,androidx.compose.ui.graphics.Color)(focus: https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration.Focus?, color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color)` Configuration for `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#ripple(kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shape,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)` appearance, provided using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#LocalRippleConfiguration()`. |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration#color()` the color override for the ripple. |
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration.Focus?` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration#focus()` the focus indication override for this ripple. |
| `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha?` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration#rippleAlpha()` **This property is deprecated.** Use other configuration options in RippleThemeConfiguration, RippleConfiguration and ripple. |

## Public constructors

### RippleConfiguration

Added in [1.8.0-alpha03](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.8.0-alpha03)

```
RippleConfiguration(color: Color = Color.Unspecified)
```

Configuration for `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#ripple(kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shape,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)` appearance, provided using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#LocalRippleConfiguration()`. In most cases the default values should be used, for custom design system use cases you should instead build your own custom ripple using `https://developer.android.com/reference/kotlin/androidx/compose/material3/ripple/package-summary#createRippleModifierNode(androidx.compose.foundation.interaction.InteractionSource,kotlin.Function0)`. To disable the ripple, provide `null` using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#LocalRippleConfiguration()`.

| Parameters |
|---|---|
| `color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color override for the ripple. If `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color#Unspecified()`, then the default color from the theme will be used instead. Note that if the ripple has a color explicitly set with the parameter on `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#ripple(kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shape,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)`, that will always be used instead of this value. |

### RippleConfiguration

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.6.0) Deprecated in [1.8.0-alpha03](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.8.0-alpha03)

```
[RippleConfiguration](https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration#RippleConfiguration(androidx.compose.ui.graphics.Color,androidx.compose.material.ripple.RippleAlpha))(
    color: Color = Color.Unspecified,
    rippleAlpha: RippleAlpha? = null
)
```

> [!CAUTION]
> **This function is deprecated.**   
> Use other configuration options in RippleThemeConfiguration, RippleConfiguration and ripple. Changing whether focus is displayed by opacity or inset focus rings is changed by providing different values with LocalRippleThemeConfiguration. Disabling individual types of interactions are displayed by a specific ripple can be done with the boolean parameters on ripple.

Configuration for `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#ripple(kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shape,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)` appearance, provided using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#LocalRippleConfiguration()`. In most cases the default values should be used, for custom design system use cases you should instead build your own custom ripple using `https://developer.android.com/reference/kotlin/androidx/compose/material3/ripple/package-summary#createRippleModifierNode(androidx.compose.foundation.interaction.InteractionSource,kotlin.Function0)`. To disable the ripple, provide `null` using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#LocalRippleConfiguration()`.

| Parameters |
|---|---|
| `color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color override for the ripple. If `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color#Unspecified()`, then the default color from the theme will be used instead. Note that if the ripple has a color explicitly set with the parameter on `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#ripple(kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shape,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)`, that will always be used instead of this value. |
| `rippleAlpha: https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha? = null` | the `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha` override for this ripple. If null, then the default alpha will be used instead. |

### RippleConfiguration

Added in [1.8.0-alpha03](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.8.0-alpha03)

```
RippleConfiguration(
    focus: RippleConfiguration.Focus?,
    color: Color = Color.Unspecified
)
```

Configuration for `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#ripple(kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shape,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)` appearance, provided using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#LocalRippleConfiguration()`. In most cases the default values should be used, for custom design system use cases you should instead build your own custom ripple using `https://developer.android.com/reference/kotlin/androidx/compose/material3/ripple/package-summary#createRippleModifierNode(androidx.compose.foundation.interaction.InteractionSource,kotlin.Function0)`. To disable the ripple, provide `null` using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#LocalRippleConfiguration()`.

| Parameters |
|---|---|
| `focus: https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RippleConfiguration.Focus?` | the focus indication override for this ripple. If null, then the default indication style will be used instead. This will only be applied if the style of focus indication matches the one set by `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#LocalRippleThemeConfiguration()` (opacity vs inset focus ring). |
| `color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color override for the ripple. If `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color#Unspecified()`, then the default color from the theme will be used instead. Note that if the ripple has a color explicitly set with the parameter on `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#ripple(kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shape,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)`, that will always be used instead of this value. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### color

```
val color: Color
```

the color override for the ripple. If `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color#Unspecified()`, then the default color from the theme will be used instead. Note that if the ripple has a color explicitly set with the parameter on `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#ripple(kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shape,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)`, that will always be used instead of this value.

### focus

Added in [1.8.0-alpha03](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.8.0-alpha03)

```
val focus: RippleConfiguration.Focus?
```

the focus indication override for this ripple. If null, then the default indication style will be used instead. This will only be applied if the style of focus indication matches the one set by `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#LocalRippleThemeConfiguration()` (opacity vs inset focus ring). If the style doesn't match, then this configuration will be ignored and the default indication style will be used instead.

### rippleAlpha

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.6.0) Deprecated in [1.8.0-alpha03](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.8.0-alpha03)

```
val rippleAlpha: RippleAlpha?
```

> [!CAUTION]
> **This property is deprecated.**   
> Use other configuration options in RippleThemeConfiguration, RippleConfiguration and ripple. Changing whether focus is displayed by opacity or inset focus rings is changed by providing different values with LocalRippleThemeConfiguration. Disabling individual types of interactions are displayed by a specific ripple can be done with the boolean parameters on ripple.

The `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha` used to configure the opacity levels of the per-ripple configuration.