Modal Bottom Sheet
fun ModalBottomSheet(state: ModalBottomSheetState, properties: ModalSheetProperties = ModalSheetProperties(), onDismiss: () -> Unit = DoNothing, content: @Composable ModalBottomSheetScope.() -> Unit)
A foundational component used to build modal bottom sheets.
For interactive preview & code examples, visit Modal Bottom Sheet Documentation.
Basic Example
val sheetState = rememberModalBottomSheetState(
initialDetent = Hidden,
)
Button(onClick = { sheetState.currentDetent = FullyExpanded }) {
Text("Show Sheet")
}
ModalBottomSheet(state = sheetState) {
Sheet(modifier = Modifier.fillMaxWidth().background(Color.White)) {
Box(
modifier = Modifier.fillMaxWidth().height(1200.dp),
contentAlignment = Alignment.TopCenter
) {
DragIndication()
}
}
}Content copied to clipboard
Parameters
state
The ModalBottomSheetState that controls the sheet.
properties
The ModalSheetProperties that control the behavior of the sheet.
on Dismiss
Callback that is called when the sheet is dismissed.
content
The content of the modal