You can also achieve it by (alternative to The Easy Way):
`
modifier = Modifier
.graphicsLayer {
shape = RoundedCornerShape(20.dp)
clip = true
}
.clickable { onClick.invoke() }
`
I find it easier in situations where we could have specified a Shape, this way ripple will respect shape.