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 ProgressRingCard() {
val sweep = remember { Animatable(0f) }
LaunchedEffect(Unit) {
sweep.animateTo(
targetValue = 0.74f,
animationSpec = tween(1200, easing = FastOutSlowInEasing),
)
}
Card(
shape = RoundedCornerShape(20.dp),
modifier = Modifier.width(260.dp),
) {
Row(
Modifier.padding(20.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Box(contentAlignment = Alignment.Center) {
Canvas(Modifier.size(72.dp)) {
drawArc(
color = Color(0xFF334155).copy(alpha = 0.2f),
startAngle = -90f,
sweepAngle = 360f,
useCenter = false,
style = Stroke(8.dp.toPx(), cap = StrokeCap.Round),
)
drawArc(
color = Color(0xFF0EA5E9),
startAngle = -90f,
sweepAngle = 360f * sweep.value,
useCenter = false,
style = Stroke(8.dp.toPx(), cap = StrokeCap.Round),
)
}
Text(
text = "${(sweep.value * 100).toInt()}%",
fontWeight = FontWeight.Bold,
)
}
Spacer(Modifier.width(16.dp))
Column {
Text(
text = "Storage Used",
fontWeight = FontWeight.SemiBold,
)
Text(
text = "37 GB of 50 GB",
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
}
}
}