Icons
Iconsanimated
Night
A crescent moon with stars twinkling beside it — a polished light/dark or night mode mark.
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 MoonStars() {
val t = rememberInfiniteTransition(label = "night")
val tw by t.animateFloat(0.3f, 1f, infiniteRepeatable(tween(900), RepeatMode.Reverse), label = "tw")
val color = MaterialTheme.colorScheme.primary
Box(Modifier.size(40.dp)) {
Icon(Icons.Filled.DarkMode, "Night", tint = color, modifier = Modifier.size(28.dp))
Icon(Icons.Filled.Star, null, tint = color.copy(alpha = tw), modifier = Modifier.size(8.dp).align(Alignment.TopEnd))
Icon(Icons.Filled.Star, null, tint = color.copy(alpha = 1.3f - tw), modifier = Modifier.size(6.dp).offset(x = 22.dp, y = 14.dp))
}
}