Badges
Badgesanimated

Recording

A recording pill with a blinking dot and a monospaced running timer.

REC00:42

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
val t = rememberInfiniteTransition(label = "rec")
val blink by t.animateFloat(
    initialValue = 1f,
    targetValue = 0.15f,
    animationSpec = infiniteRepeatable(tween(700), RepeatMode.Reverse),
    label = "blink",
)
Surface(
    shape = RoundedCornerShape(6.dp),
    color = Color(0xFF18181B),
    contentColor = Color.White,
) {
    Row(
        Modifier.padding(horizontal = 8.dp, vertical = 4.dp),
        verticalAlignment = Alignment.CenterVertically,
        horizontalArrangement = Arrangement.spacedBy(6.dp),
    ) {
        Box(
            Modifier
                .size(8.dp)
                .graphicsLayer { alpha = blink }
                .background(Color(0xFFEF4444), CircleShape),
        )
        Text("REC", fontSize = 11.sp, fontWeight = FontWeight.Bold)
        Text("00:42", fontFamily = FontFamily.Monospace, fontSize = 11.sp)
    }
}