Cards
Cardsanimated
Achievement Unlocked
Celebration card where an award medal scales in for a newly unlocked badge.
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 AchievementUnlockedCard() {
var shown by remember { mutableStateOf(false) }
LaunchedEffect(Unit) { shown = true }
val s by animateFloatAsState(
if (shown) 1f else 0.3f,
spring(Spring.DampingRatioMediumBouncy),
label = "medal"
)
ElevatedCard(
modifier = Modifier.width(260.dp),
shape = RoundedCornerShape(20.dp)
) {
Column(
Modifier.padding(20.dp).fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally
) {
Surface(
shape = CircleShape,
color = MaterialTheme.colorScheme.primaryContainer,
modifier = Modifier.scale(s)
) {
Icon(
Icons.Default.EmojiEvents,
contentDescription = null,
tint = MaterialTheme.colorScheme.primary,
modifier = Modifier.padding(16.dp).size(32.dp)
)
}
Spacer(Modifier.height(12.dp))
Text(
"Achievement Unlocked",
style = MaterialTheme.typography.titleSmall
)
Text(
"100 Day Streak",
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant
)
}
}
}