Partial bottom sheet

You can partially show a bottom sheet and then let the user either make it full screen or dismiss it.

To do so, pass your ModalBottomSheet an instance of SheetState with skipPartiallyExpanded set to false.

Example

This example demonstrates how you can use the sheetState property of ModalBottomSheet to display the sheet only partially at first:

@Composable
funPartialBottomSheet(){
varshowBottomSheetbyremember{mutableStateOf(false)}
valsheetState=rememberModalBottomSheetState(
skipPartiallyExpanded=false,
)
Column(
modifier=Modifier.fillMaxWidth(),
horizontalAlignment=Alignment.CenterHorizontally,
){
Button(
onClick={showBottomSheet=true}
){
Text("Display partial bottom sheet")
}
if(showBottomSheet){
ModalBottomSheet(
modifier=Modifier.fillMaxHeight(),
sheetState=sheetState,
onDismissRequest={showBottomSheet=false}
){
Text(
"Swipe up to open sheet. Swipe down to dismiss.",
modifier=Modifier.padding(16.dp)
)
}
}
}
}

Key points about the code

In this example, note the following:

  • showBottomSheet controls whether the app displays the bottom sheet.
  • sheetState is an instance of SheetState where skipPartiallyExpanded is false.
  • ModalBottomSheet takes a modifier that ensures it fills the screen when fully expanded.
  • ModalBottomSheet takes sheetState as the value for its sheetState parameter.
    • As a result, the sheet only partially displays when first opened. The user can then drag or swipe it to make it full screen or dismiss it.
  • The onDismissRequest lambda controls what happens when the user tries to dismiss the bottom sheet. In this case, it only removes the sheet.

Results

When the user first presses the button, the sheet displays partially:

Figure 1. Partially displayed bottom sheet.

If the user swipes up on the sheet, it fills the screen:

Figure 2. Full-screen bottom sheet.

Additional resources

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026年08月14日 UTC.