BottomSheet

fun BottomSheet(state: BottomSheetState, modifier: Modifier = Modifier, enabled: Boolean = true, content: @Composable BottomSheetScope.() -> Unit)

A foundational component used to build bottom sheets.

For interactive preview & code examples, visit Bottom Sheet Documentation.

Basic Example

val sheetState = rememberBottomSheetState(
initialDetent = Hidden,
)

Button(onClick = { sheetState.currentDetent = FullyExpanded }) {
Text("Show Sheet")
}

BottomSheet(
state = sheetState,
modifier = Modifier.fillMaxWidth(),
) {
Box(
modifier = Modifier.fillMaxWidth().height(1200.dp),
contentAlignment = Alignment.TopCenter
) {
DragIndication(Modifier.width(32.dp).height(4.dp))
}
}

Parameters

state

The BottomSheetState that controls the sheet.

modifier

Modifier to be applied to the sheet.

enabled

Whether the sheet is enabled.

content

The content of the sheet.