Cards
Cardsanimated

Bar Chart Mini

Small vertical bars grow with staggered timing beside a total figure.

Weekly Sales
1,204

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 BarChartMiniCard() {
  val bars = listOf(0.4f, 0.7f, 0.5f, 0.9f, 0.6f, 0.8f)
  val anim = bars.mapIndexed { i, t ->
    val a = remember { Animatable(0f) }
    LaunchedEffect(Unit) {
      delay(i * 90L)
      a.animateTo(t, tween(600, easing = FastOutSlowInEasing))
    }
    a
  }
  ElevatedCard(
    shape = RoundedCornerShape(18.dp),
    modifier = Modifier.width(260.dp),
  ) {
    Column(Modifier.padding(18.dp)) {
      Text(
        text = "Weekly Sales",
        style = MaterialTheme.typography.labelMedium,
        color = MaterialTheme.colorScheme.onSurfaceVariant,
      )
      Text(text = "1,204", fontWeight = FontWeight.Bold)
      Spacer(Modifier.height(12.dp))
      Row(
        Modifier
          .fillMaxWidth()
          .height(56.dp),
        horizontalArrangement = Arrangement.spacedBy(8.dp),
        verticalAlignment = Alignment.Bottom,
      ) {
        anim.forEach { a ->
          Box(
            Modifier
              .weight(1f)
              .fillMaxHeight(a.value)
              .clip(RoundedCornerShape(4.dp))
              .background(Color(0xFFF59E0B)),
          )
        }
      }
    }
  }
}