Icons
Iconsanimated

Hourglass

An hourglass with sand draining through the neck, looping while a task is pending.

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 Hourglass() {
    val t = rememberInfiniteTransition(label = "hg")
    val drain by t.animateFloat(0f, 1f, infiniteRepeatable(tween(1600), RepeatMode.Restart), label = "d")
    val color = MaterialTheme.colorScheme.primary
    Box(Modifier.size(40.dp), contentAlignment = Alignment.Center) {
        Icon(Icons.Filled.HourglassEmpty, "Loading", tint = color, modifier = Modifier.size(30.dp))
        Canvas(Modifier.size(30.dp)) {
            drawLine(color, Offset(center.x, center.y), Offset(center.x, lerp(center.y, size.height * 0.7f, drain)), 2f)
        }
    }
}