Loaders
Loadersanimated

Step tracker

A horizontal stepper whose active node pulses along connecting rails.

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 = "steps")
val active by t.animateFloat(
    initialValue = 0f,
    targetValue = 2.99f,
    animationSpec = infiniteRepeatable(tween(2400, easing = LinearEasing)),
    label = "active",
)
val primary = MaterialTheme.colorScheme.primary
val track = MaterialTheme.colorScheme.surfaceVariant
Row(
    verticalAlignment = Alignment.CenterVertically,
    horizontalArrangement = Arrangement.spacedBy(4.dp),
) {
    repeat(3) { i ->
        val on = i <= active.toInt()
        Box(
            Modifier
                .size(if (on) 14.dp else 10.dp)
                .background(if (on) primary else track, CircleShape),
        )
        if (i < 2) {
            Box(
                Modifier
                    .width(28.dp)
                    .height(3.dp)
                    .background(if (i < active.toInt()) primary else track),
            )
        }
    }
}