Cards
Cardsanimated
Milestone Progress
A stepped track lights up completed milestones toward a final reward.
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 MilestoneProgressCard() {
val steps = 5
val done = 3
val fill = remember { Animatable(0f) }
LaunchedEffect(Unit) {
fill.animateTo(
done / (steps - 1f),
tween(1000, easing = FastOutSlowInEasing),
)
}
Card(
shape = RoundedCornerShape(18.dp),
modifier = Modifier.width(260.dp),
) {
Column(Modifier.padding(18.dp)) {
Text(text = "Onboarding", fontWeight = FontWeight.SemiBold)
Spacer(Modifier.height(16.dp))
Box(Modifier.fillMaxWidth()) {
Box(
Modifier
.align(Alignment.CenterStart)
.fillMaxWidth()
.height(4.dp)
.clip(RoundedCornerShape(50))
.background(MaterialTheme.colorScheme.surfaceVariant),
)
Box(
Modifier
.align(Alignment.CenterStart)
.fillMaxWidth(fill.value)
.height(4.dp)
.clip(RoundedCornerShape(50))
.background(Color(0xFF6366F1)),
)
Row(
Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween,
) {
repeat(steps) { i ->
Box(
Modifier
.size(14.dp)
.clip(CircleShape)
.background(
if (i <= done) Color(0xFF6366F1)
else MaterialTheme.colorScheme.surfaceVariant,
),
)
}
}
}
}
}
}