Cards
Cardsanimated

Online Status Pulse

Profile card with a pulsing green dot signaling the user is online now.

OZ
Oz Patel
Online

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 OnlinePulseCard() {
    val t = rememberInfiniteTransition(label = "pulse")
    val r by t.animateFloat(
        0.6f, 1f,
        infiniteRepeatable(
            tween(900), RepeatMode.Reverse
        ),
        label = "alpha"
    )
    Card(
        modifier = Modifier.width(260.dp),
        shape = RoundedCornerShape(18.dp)
    ) {
        Row(
            Modifier.padding(16.dp),
            verticalAlignment = Alignment.CenterVertically
        ) {
            Box {
                Box(
                    Modifier.size(46.dp).clip(CircleShape)
                        .background(
                            MaterialTheme.colorScheme.primary
                        ),
                    contentAlignment = Alignment.Center
                ) { Text("OZ") }
                Box(
                    Modifier.align(Alignment.BottomEnd)
                        .size(14.dp).clip(CircleShape)
                        .background(
                            Color(0xFF22C55E).copy(alpha = r)
                        )
                        .border(
                            2.dp,
                            MaterialTheme.colorScheme.surface,
                            CircleShape
                        )
                )
            }
            Spacer(Modifier.width(12.dp))
            Column {
                Text(
                    "Oz Patel",
                    style = MaterialTheme.typography.titleSmall
                )
                Text(
                    "Online",
                    style = MaterialTheme.typography.bodySmall,
                    color = Color(0xFF22C55E)
                )
            }
        }
    }
}