androidx.compose.material3.ripple

Interfaces

RippleNodeConfiguration.DragConfiguration

Represents the configuration for the visual representation of drag

Cmn
RippleNodeConfiguration.FocusConfiguration

Represents the configuration for the visual representation of focus

Cmn
RippleNodeConfiguration.HoverConfiguration

Represents the configuration for the visual representation of hover

Cmn
RippleNodeConfiguration.PressConfiguration

Represents the configuration for the visual representation of a press

Cmn

Classes

RippleNodeConfiguration

The configuration for the ripple node created by createRippleModifierNode.

Cmn
RippleNodeConfiguration.DragConfiguration.Opacity

An opacity-based drag visual.

Cmn
RippleNodeConfiguration.FocusConfiguration.InsetRing

An inset ring focus visual - the created ripple will show an inset focus ring.

Cmn
RippleNodeConfiguration.FocusConfiguration.Opacity

An opacity-based focus visual.

Cmn
RippleNodeConfiguration.HoverConfiguration.Opacity

An opacity-based hover visual.

Cmn
RippleNodeConfiguration.PressConfiguration.Opacity

An opacity-based press visual - the created ripple will show a layer with the given alpha on a press.

Cmn

Objects

RippleNodeConfiguration.DragConfiguration.None

No drag visual - the created ripple will not show anything for drag.

Cmn
RippleNodeConfiguration.FocusConfiguration.None

No focus visual - the created ripple will not show anything for focus.

Cmn
RippleNodeConfiguration.HoverConfiguration.None

No hover visual - the created ripple will not show anything for hover.

Cmn
RippleNodeConfiguration.PressConfiguration.None

No press visual - the created ripple will not show anything for press.

Cmn

Top-level functions summary

DelegatableNode
createRippleModifierNode(
    interactionSource: InteractionSource,
    rippleNodeConfiguration: () -> RippleNodeConfiguration
)

Creates a Ripple node using the values provided.

Cmn

Top-level functions

createRippleModifierNode

fun createRippleModifierNode(
    interactionSource: InteractionSource,
    rippleNodeConfiguration: () -> RippleNodeConfiguration
): DelegatableNode

Creates a Ripple node using the values provided.

A Ripple is a Material 3 node that expresses different Interactions by drawing ripple animations, and state layers, and other graphical effects.

A Ripple responds to PressInteraction.Press by starting a new RippleAnimation, and responds to other Interactions by showing a fixed state layer with varying alpha values depending on the Interaction, or an inset ring for FocusInteraction, depending on the supplied RippleNodeConfiguration.

This Ripple node is a low level building block for building IndicationNodeFactory implementations that use a Ripple - higher level design system libraries such as material3 provide ripple 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 DelegatingNode.delegate, ensure that the node is created once or DelegatingNode.undelegate is called in Modifier.Node.onDetach. Repeatedly delegating to a new node returned by this method in Modifier.Node.onAttach without removing the old one will result in multiple ripple nodes being attached to the node.

Parameters
interactionSource: InteractionSource

the InteractionSource used to determine the state of the ripple.

rippleNodeConfiguration: () -> RippleNodeConfiguration

the RippleNodeConfiguration that will be applied to the ripple depending on the state of the ripple. This lambda may be invoked repeatedly, so consider caching values of configuration when they haven't changed.