Loaders
Loadersanimated

Bar chart

Four columns rising to staggered heights like a chart populating data.

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 = "barchart")
val targets = listOf(0.5f, 0.9f, 0.65f, 1f)
Row(
    modifier = Modifier.height(40.dp),
    verticalAlignment = Alignment.Bottom,
    horizontalArrangement = Arrangement.spacedBy(5.dp),
) {
    targets.forEachIndexed { i, target ->
        val h by t.animateFloat(
            initialValue = 0.15f,
            targetValue = target,
            animationSpec = infiniteRepeatable(
                tween(800, delayMillis = i * 120),
                RepeatMode.Reverse,
            ),
            label = "h",
        )
        Box(
            Modifier
                .width(8.dp)
                .fillMaxHeight(h)
                .background(
                    MaterialTheme.colorScheme.primary,
                    RoundedCornerShape(topStart = 3.dp, topEnd = 3.dp),
                ),
        )
    }
}