Cards
Cardsanimated

Savings Goal Jar

Savings goal card with a jar that fills using a gently rising liquid level.

Vacation Fund
$3,600 / $5,000
72% saved

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 SavingsJarCard() {
  val fill = remember { Animatable(0f) }
  LaunchedEffect(Unit) { fill.animateTo(0.72f, tween(1300)) }
  val liquid = MaterialTheme.colorScheme.primary
  Card(
    modifier = Modifier.fillMaxWidth().padding(16.dp),
    shape = RoundedCornerShape(20.dp)
  ) {
    Row(
      Modifier.padding(20.dp),
      verticalAlignment = Alignment.CenterVertically
    ) {
      Box(
        Modifier
          .size(64.dp, 80.dp)
          .clip(RoundedCornerShape(12.dp))
          .background(MaterialTheme.colorScheme.surfaceVariant)
      ) {
        Box(
          Modifier
            .fillMaxWidth()
            .fillMaxHeight(fill.value)
            .align(Alignment.BottomCenter)
            .background(liquid.copy(alpha = 0.7f))
        )
        Icon(
          Icons.Filled.PiggyBank, null,
          modifier = Modifier.align(Alignment.Center).size(28.dp),
          tint = MaterialTheme.colorScheme.onSurface
        )
      }
      Spacer(Modifier.width(20.dp))
      Column {
        Text("Vacation Fund",
          style = MaterialTheme.typography.titleSmall,
          fontWeight = FontWeight.SemiBold)
        Text("$3,600 / $5,000",
          style = MaterialTheme.typography.bodyMedium)
        Text("72% saved",
          style = MaterialTheme.typography.bodySmall,
          color = MaterialTheme.colorScheme.primary)
      }
    }
  }
}