Menus
Menus

Descriptive items

A menu whose rows pair a title with a secondary description line.

Public

Anyone with the link

Team

Only your workspace

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 DescriptiveMenu() {
    var open by remember { mutableStateOf(false) }
    val items = listOf(
        Triple("Public", "Anyone with the link", Icons.Filled.Public),
        Triple("Team", "Only your workspace", Icons.Filled.Group),
        Triple("Private", "Only you", Icons.Filled.Lock),
    )
    Box {
        TextButton(onClick = { open = true }) { Text("Visibility") }
        DropdownMenu(expanded = open, onDismissRequest = { open = false }) {
            items.forEach { (title, desc, icon) ->
                DropdownMenuItem(
                    leadingIcon = { Icon(icon, null) },
                    text = {
                        Column {
                            Text(title, style = MaterialTheme.typography.bodyMedium)
                            Text(desc, style = MaterialTheme.typography.labelSmall,
                                color = MaterialTheme.colorScheme.onSurfaceVariant)
                        }
                    },
                    onClick = { open = false },
                )
            }
        }
    }
}