Menus
Menus

Grid actions

A share-style sheet of icon tiles laid out in a quick-action grid.

Copy
Share
Save
Delete

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
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun GridActions(onDismiss: () -> Unit) {
    val actions = listOf(
        "Copy" to Icons.Filled.ContentCopy,
        "Share" to Icons.Filled.Share,
        "Save" to Icons.Filled.Download,
        "Delete" to Icons.Filled.DeleteOutline,
    )
    ModalBottomSheet(onDismissRequest = onDismiss) {
        LazyVerticalGrid(
            columns = GridCells.Fixed(4),
            modifier = Modifier.padding(16.dp),
        ) {
            items(actions) { (label, icon) ->
                Column(
                    Modifier.clickable { onDismiss() }.padding(8.dp),
                    horizontalAlignment = Alignment.CenterHorizontally,
                ) {
                    Surface(shape = CircleShape,
                        color = MaterialTheme.colorScheme.surfaceVariant,
                        modifier = Modifier.size(48.dp)) {
                        Box(contentAlignment = Alignment.Center) { Icon(icon, label) }
                    }
                    Text(label, Modifier.padding(top = 6.dp),
                        style = MaterialTheme.typography.labelSmall)
                }
            }
        }
    }
}