Cards
Cardsanimated

Calories Burned

Energy burn card with an animated flame and progress toward the move goal.

642 kcal

Goal 1,000 kcal

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 CaloriesCard() {
  val t = rememberInfiniteTransition(label = "flame")
  val flick by t.animateFloat(
    0.9f, 1.15f,
    infiniteRepeatable(
      tween(600), repeatMode = RepeatMode.Reverse
    ), label = "flick"
  )
  val prog by animateFloatAsState(
    0.64f, tween(1000), label = "p"
  )
  ElevatedCard(Modifier.fillMaxWidth()) {
    Column(Modifier.padding(20.dp)) {
      Row(verticalAlignment = Alignment.CenterVertically) {
        Box(Modifier.graphicsLayer {
          scaleY = flick
        }) {
          Canvas(Modifier.size(26.dp)) {
            drawCircle(Color(0xFFFF9500))
          }
        }
        Spacer(Modifier.width(10.dp))
        Text(
          "642 kcal",
          style = MaterialTheme.typography.headlineSmall
        )
      }
      Spacer(Modifier.height(14.dp))
      LinearProgressIndicator(
        progress = { prog },
        modifier = Modifier.fillMaxWidth().height(8.dp),
        color = Color(0xFFFF9500)
      )
      Spacer(Modifier.height(8.dp))
      Text(
        "Goal 1,000 kcal",
        style = MaterialTheme.typography.labelMedium
      )
    }
  }
}