Cards
Cardsanimated

Weather Alert

Severe-weather banner card with a pulsing warning icon and advisory text.

Storm Warning

Heavy rain until 9 PM. Avoid travel.

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 WeatherAlertCard() {
  val t = rememberInfiniteTransition(label = "alert")
  val pulse by t.animateFloat(
    0.7f, 1f,
    infiniteRepeatable(
      tween(800), repeatMode = RepeatMode.Reverse
    ), label = "pulse"
  )
  Card(
    Modifier.fillMaxWidth(),
    colors = CardDefaults.cardColors(
      containerColor = Color(0xFFFFF3E0)
    )
  ) {
    Row(
      Modifier.padding(20.dp),
      verticalAlignment = Alignment.CenterVertically
    ) {
      Box(Modifier.graphicsLayer { alpha = pulse }) {
        Canvas(Modifier.size(34.dp)) {
          drawCircle(Color(0xFFFF9500))
        }
      }
      Spacer(Modifier.width(16.dp))
      Column {
        Text(
          "Storm Warning",
          style = MaterialTheme.typography.titleMedium,
          color = Color(0xFFE65100)
        )
        Text(
          "Heavy rain until 9 PM. Avoid travel.",
          style = MaterialTheme.typography.bodySmall,
          color = Color(0xFFBF5600)
        )
      }
    }
  }
}