Command
Command

No results

A palette empty state that echoes the query and offers a fallback action.

No results for "reprt"

Create "reprt"

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 CommandEmpty(query: String) {
    Column(
        Modifier.fillMaxWidth().padding(28.dp),
        horizontalAlignment = Alignment.CenterHorizontally,
    ) {
        Icon(Icons.Filled.SearchOff, null, Modifier.size(36.dp),
            tint = MaterialTheme.colorScheme.onSurfaceVariant)
        Text("No results for \"$query\"", Modifier.padding(top = 8.dp),
            style = MaterialTheme.typography.bodyMedium)
        TextButton(onClick = {}, modifier = Modifier.padding(top = 4.dp)) {
            Icon(Icons.Filled.Add, null, Modifier.size(16.dp))
            Spacer(Modifier.width(6.dp))
            Text("Create \"$query\"")
        }
    }
}