# ModalBottomSheetLayout

> ModalBottomSheetLayout from Material Compose (`androidx.compose.material:material`) for Jetpack Compose, with a code sample.

- Library: [Material Compose](https://composables.com/material-components/material-compose.md)
- Category: [Modals](https://composables.com/material-components/modals.md)
- Category: [Sheets](https://composables.com/material-components/sheets.md)
- API reference and more examples: [ModalBottomSheetLayout](https://composables.com/jetpack-compose/androidx.compose.material/material/components/ModalBottomSheetLayout/api.md)

## Code

```kotlin
@Composable
@OptIn(ExperimentalMaterialApi::class)
fun ModalBottomSheetSample() {
    var skipHalfExpanded by remember { mutableStateOf(false) }
    val state =
        rememberModalBottomSheetState(
            initialValue = ModalBottomSheetValue.Hidden,
            skipHalfExpanded = skipHalfExpanded,
        )
    val scope = rememberCoroutineScope()
    ModalBottomSheetLayout(
        sheetState = state,
        sheetContent = {
            LazyColumn {
                items(50) {
                    ListItem(
                        text = { Text("Item $it") },
                        icon = {
                            Icon(
                                Icons.Default.Favorite,
                                contentDescription = "Localized description",
                            )
                        },
                    )
                }
            }
        },
    ) {
        Column(
            modifier = Modifier.fillMaxSize().padding(16.dp),
            horizontalAlignment = Alignment.CenterHorizontally,
        ) {
            Row(
                Modifier.toggleable(
                    value = skipHalfExpanded,
                    role = Role.Checkbox,
                    onValueChange = { checked -> skipHalfExpanded = checked },
                )
            ) {
                Checkbox(checked = skipHalfExpanded, onCheckedChange = null)
                Spacer(Modifier.width(16.dp))
                Text("Skip Half Expanded State")
            }
            Spacer(Modifier.height(20.dp))
            Button(onClick = { scope.launch { state.show() } }) { Text("Click to show sheet") }
        }
    }
}
```
