Cards
Cardsanimated

Discount Flame Badge

Hot-deal card with a pulsing flame discount badge over the image.

-40%
Hot Sneakers

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 DiscountFlameCard() {
  val pulse = rememberInfiniteTransition(label = "p")
  val scale by pulse.animateFloat(
    1f, 1.15f,
    infiniteRepeatable(tween(700), RepeatMode.Reverse),
    label = "s"
  )
  Card(
    modifier = Modifier.width(240.dp),
    shape = RoundedCornerShape(18.dp)
  ) {
    Box {
      Box(
        Modifier
          .fillMaxWidth()
          .height(140.dp)
          .background(MaterialTheme.colorScheme.surfaceVariant)
      )
      Surface(
        color = MaterialTheme.colorScheme.errorContainer,
        shape = RoundedCornerShape(12.dp),
        modifier = Modifier
          .padding(10.dp)
          .scale(scale)
      ) {
        Row(Modifier.padding(6.dp),
          verticalAlignment = Alignment.CenterVertically) {
          Icon(Icons.Default.Whatshot, null,
            modifier = Modifier.size(14.dp))
          Text(" -40%", style = MaterialTheme.typography.labelMedium)
        }
      }
    }
    Text("Hot Sneakers", Modifier.padding(16.dp),
      style = MaterialTheme.typography.titleMedium)
  }
}