How to set Background Color for Material3 Card in Android Compose?
Piggy backing fro this question. The answers tells how to set a background color. When material3 card is pressed, it changes color with a ripple effect. But how can I change the effect color when it is pressed?
CardDefaults.cardColors(....) doesn't do it
The
Cardwith theonClickvariant uses internally anindication = rememberRipple(). This creates and remembers a Ripple using values provided byRippleTheme.You can provide a custom
LocalRippleThemeto override the default behaviour:with:
Otherwise you can use the
clickablemodifier:Finally if you want to modify the background color when the Card is pressed (not the ripple effect) you can use: