Cards
Cardsanimated

Weekly Bars

Seven day-labelled bars rise to show a weekly activity pattern.

Steps This Week
MTWTFSS

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 WeeklyBarsCard() {
  val days = listOf("M", "T", "W", "T", "F", "S", "S")
  val vals = listOf(0.5f, 0.8f, 0.4f, 0.9f, 0.6f, 0.3f, 0.7f)
  val anim = vals.mapIndexed { i, t ->
    val a = remember { Animatable(0f) }
    LaunchedEffect(Unit) {
      delay(i * 70L)
      a.animateTo(t, tween(500, easing = FastOutSlowInEasing))
    }
    a
  }
  ElevatedCard(
    shape = RoundedCornerShape(18.dp),
    modifier = Modifier.width(260.dp),
  ) {
    Column(Modifier.padding(18.dp)) {
      Text(text = "Steps This Week", fontWeight = FontWeight.SemiBold)
      Spacer(Modifier.height(14.dp))
      Row(
        Modifier
          .fillMaxWidth()
          .height(64.dp),
        horizontalArrangement = Arrangement.spacedBy(6.dp),
        verticalAlignment = Alignment.Bottom,
      ) {
        days.forEachIndexed { i, d ->
          Column(
            Modifier.weight(1f),
            horizontalAlignment = Alignment.CenterHorizontally,
          ) {
            Box(
              Modifier
                .fillMaxWidth()
                .fillMaxHeight(anim[i].value)
                .clip(RoundedCornerShape(4.dp))
                .background(Color(0xFF14B8A6)),
            )
          }
        }
      }
      Spacer(Modifier.height(6.dp))
      Row(
        Modifier.fillMaxWidth(),
        horizontalArrangement = Arrangement.spacedBy(6.dp),
      ) {
        days.forEach { d ->
          Text(
            text = d,
            style = MaterialTheme.typography.labelSmall,
            color = MaterialTheme.colorScheme.onSurfaceVariant,
            modifier = Modifier.weight(1f),
            textAlign = TextAlign.Center,
          )
        }
      }
    }
  }
}