Inputs
Inputsicon

Search suggestions

Search field with a dropdown of matching suggestions that fades in below it.

Compose
Coroutines
Coil

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
var q by remember { mutableStateOf("") }
val matches = remember(q) {
    listOf("Compose", "Coroutines", "Coil").filter {
        q.isNotEmpty() && it.startsWith(q, ignoreCase = true)
    }
}
Column {
    OutlinedTextField(
        value = q,
        onValueChange = { q = it },
        leadingIcon = { Icon(Icons.Filled.Search, null) },
        placeholder = { Text("Search docs…") },
        singleLine = true,
    )
    AnimatedVisibility(matches.isNotEmpty()) {
        Surface(tonalElevation = 2.dp) {
            Column { matches.forEach { ListItem(headlineContent = { Text(it) }) } }
        }
    }
}