Icons
Iconsanimated

Location

A map pin that drops onto the surface and casts an expanding ripple where it lands.

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 LocationDrop(active: Boolean) {
    val y by animateFloatAsState(if (active) 0f else -16f,
        spring(dampingRatio = Spring.DampingRatioMediumBouncy, stiffness = 400f), label = "drop")
    val ripple by rememberInfiniteTransition(label = "r").animateFloat(
        0f, 1f, infiniteRepeatable(tween(1400), RepeatMode.Restart), label = "rp")
    val color = MaterialTheme.colorScheme.primary
    Box(Modifier.size(40.dp), contentAlignment = Alignment.BottomCenter) {
        Canvas(Modifier.matchParentSize()) {
            drawCircle(color.copy(alpha = (1f - ripple) * 0.5f), size.width * 0.3f * ripple,
                Offset(center.x, size.height * 0.86f), style = Stroke(2.dp.toPx()))
        }
        Icon(Icons.Filled.LocationOn, "Location", tint = color, modifier = Modifier.size(26.dp).offset(y = y.dp))
    }
}