Cards
Cardsanimated

Crypto Ticker

Bitcoin price ticker with a pulsing live dot and shifting price value.

BTC / USD
$67,420.18
+3.1%

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 CryptoTickerCard() {
  val t = rememberInfiniteTransition(label = "pulse")
  val pulse by t.animateFloat(
    0.4f, 1f,
    infiniteRepeatable(tween(900), RepeatMode.Reverse),
    label = "p"
  )
  OutlinedCard(
    modifier = Modifier.fillMaxWidth().padding(16.dp),
    shape = RoundedCornerShape(20.dp)
  ) {
    Row(
      Modifier.padding(18.dp),
      verticalAlignment = Alignment.CenterVertically
    ) {
      Icon(
        Icons.Filled.Bitcoin, null,
        tint = Color(0xFFF7931A),
        modifier = Modifier.size(34.dp)
      )
      Spacer(Modifier.width(14.dp))
      Column(Modifier.weight(1f)) {
        Row(verticalAlignment = Alignment.CenterVertically) {
          Text("BTC / USD",
            style = MaterialTheme.typography.labelMedium)
          Spacer(Modifier.width(6.dp))
          Box(
            Modifier
              .size(8.dp)
              .graphicsLayer { alpha = pulse }
              .background(Color(0xFF22C55E), CircleShape)
          )
        }
        Text(
          "$67,420.18",
          style = MaterialTheme.typography.titleLarge,
          fontWeight = FontWeight.Bold
        )
      }
      Text(
        "+3.1%",
        color = Color(0xFF22C55E),
        fontWeight = FontWeight.SemiBold
      )
    }
  }
}