Cards
Cardsanimated

Travel Budget

Travel budget card with animated spending arc and remaining funds total.

70%

$1,400 spent

$600 remaining

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 TravelBudgetCard() {
  val sweep = remember { Animatable(0f) }
  LaunchedEffect(Unit) { sweep.animateTo(0.7f, tween(1400)) }
  ElevatedCard(
    modifier = Modifier.fillMaxWidth().padding(16.dp)
  ) {
    Row(
      Modifier.padding(20.dp),
      verticalAlignment = Alignment.CenterVertically
    ) {
      Canvas(Modifier.size(64.dp)) {
        drawArc(
          Color.Gray.copy(0.2f), 0f, 360f, false,
          style = Stroke(8f)
        )
        drawArc(
          Color(0xFF6366F1), -90f, 360f * sweep.value,
          false, style = Stroke(8f)
        )
      }
      Spacer(Modifier.width(18.dp))
      Column {
        Text("$1,400 spent",
          style = MaterialTheme.typography.titleMedium)
        Text("$600 remaining",
          style = MaterialTheme.typography.bodySmall)
      }
    }
  }
}