Badges
NEW
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
val t = rememberInfiniteTransition(label = "sparkle")
Box {
Surface(
shape = RoundedCornerShape(50),
color = Color(0xFFD946EF),
contentColor = Color.White,
) {
Text(
"NEW",
Modifier.padding(horizontal = 12.dp, vertical = 4.dp),
fontSize = 12.sp,
fontWeight = FontWeight.Bold,
)
}
listOf(
Offset(-4f, -4f) to 0,
Offset(48f, 2f) to 400,
Offset(40f, 20f) to 800,
).forEach { (o, delay) ->
val a by t.animateFloat(
initialValue = 0.2f,
targetValue = 1f,
animationSpec = infiniteRepeatable(
tween(900, delayMillis = delay),
RepeatMode.Reverse,
),
label = "tw",
)
Icon(
Icons.Filled.AutoAwesome,
contentDescription = null,
tint = Color(0xFFF0ABFC),
modifier = Modifier
.size(10.dp)
.offset(o.x.dp, o.y.dp)
.graphicsLayer { alpha = a; scaleX = a; scaleY = a },
)
}
}