Cards
Cardsanimated

Standing Hours

Twelve-segment stand ring fills one wedge per hour the user stood up.

Stand

9 / 12 hrs

On track

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 StandingHoursCard() {
  val stood = 9
  val fill by animateFloatAsState(
    targetValue = stood.toFloat(),
    animationSpec = tween(1000), label = "fill"
  )
  ElevatedCard(Modifier.fillMaxWidth()) {
    Row(
      Modifier.padding(20.dp),
      verticalAlignment = Alignment.CenterVertically
    ) {
      Canvas(Modifier.size(90.dp)) {
        val total = 12
        val gap = 6f
        val sweep = 360f / total - gap
        for (i in 0 until total) {
          val start = -90f + i * (360f / total)
          val c = if (i < fill) Color(0xFF50E3C2)
            else Color(0xFFE0E0E0)
          drawArc(
            c, start, sweep, false,
            style = Stroke(12f, cap = StrokeCap.Round)
          )
        }
      }
      Spacer(Modifier.width(20.dp))
      Column {
        Text(
          "Stand",
          color = MaterialTheme.colorScheme.onSurfaceVariant
        )
        Text(
          "9 / 12 hrs",
          style = MaterialTheme.typography.headlineSmall
        )
        Text(
          "On track",
          style = MaterialTheme.typography.labelMedium
        )
      }
    }
  }
}