Loaders
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 = "fan")
val angle by t.animateFloat(
initialValue = 0f,
targetValue = 360f,
animationSpec = infiniteRepeatable(tween(1300, easing = LinearEasing)),
label = "angle",
)
val primary = MaterialTheme.colorScheme.primary
Canvas(Modifier.size(40.dp)) {
repeat(3) { i ->
val inset = i * 5.dp.toPx()
val r = size.minDimension / 2f - inset
rotate(angle + i * 40f) {
drawArc(
color = primary.copy(alpha = 1f - i * 0.25f),
startAngle = 0f,
sweepAngle = 90f,
useCenter = false,
topLeft = Offset(center.x - r, center.y - r),
size = Size(r * 2, r * 2),
style = Stroke(width = 3.dp.toPx(), cap = StrokeCap.Round),
)
}
}
}