Loaders
Loadersanimated

Galaxy

Nested rings spinning at different speeds around a glowing core.

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 = "galaxy")
val a1 by t.animateFloat(
    0f, 360f,
    infiniteRepeatable(tween(1000, easing = LinearEasing)),
    label = "a1",
)
val a2 by t.animateFloat(
    0f, 360f,
    infiniteRepeatable(tween(1600, easing = LinearEasing)),
    label = "a2",
)
val primary = MaterialTheme.colorScheme.primary
val tertiary = MaterialTheme.colorScheme.tertiary
Box(Modifier.size(40.dp), contentAlignment = Alignment.Center) {
    Box(
        Modifier
            .fillMaxSize()
            .rotate(a1)
            .border(2.dp, primary.copy(alpha = 0.4f), CircleShape),
    )
    Box(
        Modifier
            .fillMaxSize(0.6f)
            .rotate(-a2)
            .border(2.dp, tertiary.copy(alpha = 0.6f), CircleShape),
    )
    Box(Modifier.size(8.dp).background(primary, CircleShape))
}