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 PaymentSuccessCard() {
val draw = remember { Animatable(0f) }
LaunchedEffect(Unit) {
draw.animateTo(1f, tween(700, easing = FastOutSlowInEasing))
}
val ok = Color(0xFF22C55E)
ElevatedCard(
modifier = Modifier.fillMaxWidth().padding(16.dp),
shape = RoundedCornerShape(22.dp)
) {
Column(
Modifier.fillMaxWidth().padding(24.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
Canvas(Modifier.size(64.dp)) {
drawCircle(
ok.copy(alpha = 0.15f), radius = size.minDimension / 2
)
val p = Path().apply {
moveTo(size.width * 0.28f, size.height * 0.52f)
lineTo(size.width * 0.44f, size.height * 0.68f)
lineTo(size.width * 0.74f, size.height * 0.34f)
}
val m = PathMeasure().apply { setPath(p, false) }
val seg = Path()
m.getSegment(0f, m.length * draw.value, seg, true)
drawPath(seg, ok, style = Stroke(6f, cap = StrokeCap.Round))
}
Spacer(Modifier.height(14.dp))
Text("Payment Sent",
style = MaterialTheme.typography.titleMedium,
fontWeight = FontWeight.Bold)
Text("$240.00 to Jordan",
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant)
}
}
}