Badges
Badgesanimated

Pin drop

A location chip whose map pin drops in and settles with a small bounce.

Nearby

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 = "drop")
val y by t.animateFloat(
    initialValue = 0f,
    targetValue = 0f,
    animationSpec = infiniteRepeatable(
        keyframes {
            durationMillis = 2000
            (-10f) at 0
            0f at 500 using EaseOutBounce
            0f at 2000
        },
    ),
    label = "y",
)
val rose = Color(0xFFE11D48)
Surface(
    shape = RoundedCornerShape(50),
    color = rose.copy(alpha = 0.12f),
    contentColor = rose,
) {
    Row(
        Modifier.padding(start = 6.dp, end = 10.dp, top = 4.dp, bottom = 4.dp),
        verticalAlignment = Alignment.CenterVertically,
        horizontalArrangement = Arrangement.spacedBy(4.dp),
    ) {
        Icon(
            Icons.Filled.LocationOn,
            contentDescription = null,
            modifier = Modifier.size(15.dp).offset(y = y.dp),
        )
        Text("Nearby", fontSize = 12.sp, fontWeight = FontWeight.Medium)
    }
}