fun Modifier.ripple(onClick: () -> Unit): Modifier = composed { val source = MutableInteractionSource() indication(interactionSource = source, indication = rememberRipple()) .pointerInput(Unit) { detectTapGestures( onPress = { offset -> val press = PressInteraction.Press(offset) source.emit(press) tryAwaitRelease() source.emit(PressInteraction.Release(press)) onClick() } ) }