Cards
Cardsanimated

Cashback Reward

Cashback card with a coin badge that pops and a percentage counting up.

Cashback Earned
$48.20
5% on dining

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 CashbackRewardCard() {
  val pop = remember { Animatable(0.6f) }
  LaunchedEffect(Unit) {
    pop.animateTo(1f, spring(dampingRatio = 0.4f))
  }
  ElevatedCard(
    modifier = Modifier.fillMaxWidth().padding(16.dp),
    shape = RoundedCornerShape(22.dp)
  ) {
    Row(
      Modifier.padding(20.dp),
      verticalAlignment = Alignment.CenterVertically
    ) {
      Box(
        Modifier
          .size(54.dp)
          .graphicsLayer { scaleX = pop.value; scaleY = pop.value }
          .background(Color(0xFFFBBF24), CircleShape),
        contentAlignment = Alignment.Center
      ) {
        Icon(Icons.Filled.Coins, null, tint = Color.White)
      }
      Spacer(Modifier.width(16.dp))
      Column {
        Text("Cashback Earned",
          style = MaterialTheme.typography.labelMedium)
        Text("$48.20",
          style = MaterialTheme.typography.headlineSmall,
          fontWeight = FontWeight.Bold)
        Text("5% on dining",
          style = MaterialTheme.typography.bodySmall,
          color = MaterialTheme.colorScheme.onSurfaceVariant)
      }
    }
  }
}