Cards
Installation
caveui components are copy-paste Jetpack Compose built entirely on Material 3 — there's no caveui dependency to add. Make sure Material 3 is on your classpath (it ships with the Compose BOM), then copy the Usage snippet below into your project.
kotlin
// build.gradle.kts (module)
dependencies {
implementation(platform("androidx.compose:compose-bom:2025.06.00"))
implementation("androidx.compose.material3:material3")
}Usage
kotlin
@Composable
fun WishlistHeartCard() {
var liked by remember { mutableStateOf(false) }
val scale by animateFloatAsState(
if (liked) 1.3f else 1f,
spring(Spring.DampingRatioMediumBouncy)
)
Card(
modifier = Modifier.width(240.dp),
shape = RoundedCornerShape(18.dp)
) {
Box {
Box(
Modifier
.fillMaxWidth()
.height(140.dp)
.background(MaterialTheme.colorScheme.surfaceVariant)
)
IconButton(
onClick = { liked = !liked },
modifier = Modifier.align(Alignment.TopEnd).scale(scale)
) {
Icon(
if (liked) Icons.Filled.Favorite
else Icons.Outlined.FavoriteBorder,
null,
tint = if (liked) MaterialTheme.colorScheme.error
else MaterialTheme.colorScheme.onSurface
)
}
}
Text("Silk Scarf", Modifier.padding(16.dp),
style = MaterialTheme.typography.titleMedium)
}
}