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 PlaylistStack(name: String, count: Int) {
var open by remember { mutableStateOf(false) }
val spread by animateFloatAsState(
targetValue = if (open) 1f else 0f,
animationSpec = spring(),
label = "spread",
)
Card(
shape = RoundedCornerShape(20.dp),
modifier = Modifier
.fillMaxWidth()
.clickable { open = !open },
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.padding(16.dp),
) {
Box(Modifier.size(72.dp)) {
listOf(
Color(0xFF6366F1),
Color(0xFFEC4899),
Color(0xFF14B8A6),
).forEachIndexed { i, c ->
Box(
modifier = Modifier
.size(56.dp)
.graphicsLayer {
translationX = i * 8.dp.toPx() * (1f + spread)
rotationZ = (i - 1) * 6f * spread
}
.clip(RoundedCornerShape(10.dp))
.background(c),
)
}
}
Spacer(Modifier.width(16.dp))
Column {
Text(name, style = MaterialTheme.typography.titleMedium)
Text(
"$count tracks",
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
}
}
}