Cards
Cardsanimated

Uptime Status

A row of status ticks shows recent uptime with a healthy percentage.

API Uptime99.2%

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 UptimeStatusCard() {
  val bars = List(24) { if (it == 9 || it == 17) 0.3f else 1f }
  OutlinedCard(
    shape = RoundedCornerShape(18.dp),
    modifier = Modifier.width(260.dp),
  ) {
    Column(Modifier.padding(18.dp)) {
      Row(
        Modifier.fillMaxWidth(),
        horizontalArrangement = Arrangement.SpaceBetween,
        verticalAlignment = Alignment.CenterVertically,
      ) {
        Text(text = "API Uptime", fontWeight = FontWeight.SemiBold)
        Text(
          text = "99.2%",
          color = Color(0xFF22C55E),
          fontWeight = FontWeight.Bold,
        )
      }
      Spacer(Modifier.height(12.dp))
      Row(
        Modifier
          .fillMaxWidth()
          .height(30.dp),
        horizontalArrangement = Arrangement.spacedBy(2.dp),
      ) {
        bars.forEachIndexed { i, h ->
          val a = remember { Animatable(0f) }
          LaunchedEffect(Unit) {
            delay(i * 25L)
            a.animateTo(1f, tween(250))
          }
          Box(
            Modifier
              .weight(1f)
              .fillMaxHeight()
              .graphicsLayer { alpha = a.value }
              .clip(RoundedCornerShape(2.dp))
              .background(
                if (h < 1f) Color(0xFFF59E0B)
                else Color(0xFF22C55E),
              ),
          )
        }
      }
    }
  }
}