Icons
Iconsanimated

Search scan

A magnifier that drifts across the surface while a scan line passes through its lens.

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 SearchScan() {
    val t = rememberInfiniteTransition(label = "scan")
    val scan by t.animateFloat(0f, 1f, infiniteRepeatable(tween(1200), RepeatMode.Reverse), label = "s")
    val color = LocalContentColor.current
    val accent = MaterialTheme.colorScheme.primary
    Box(Modifier.size(40.dp), contentAlignment = Alignment.Center) {
        Icon(Icons.Filled.Search, "Search", tint = color, modifier = Modifier.size(32.dp))
        Canvas(Modifier.size(32.dp)) {
            val r = size.width * 0.28f
            val y = lerp(center.y - r, center.y + r, scan)
            drawLine(accent, Offset(center.x - r, y), Offset(center.x + r, y), 2.5.dp.toPx(), StrokeCap.Round)
        }
    }
}