You will need to use ModalBottomSheetLayout to have a bottom sheet with gray background above it like you showed in the example image provided.
If you use the regularBottomSheetScaffold the behaviour is different, being the bottom sheet displayed without background on above it.
EDIT:
Take into account that Material 3 removed these components (why google, why!?) so in case you want to use them (or you are migrating to Material 3), just copy the source code from Material into your project.
(that’s what I did, to be able to use ModalBottomSheetLayout in a project with Material 3)
2
Answers
You can either use what’s provided by Jetpack Compose, find more info here
Jetpack Compose Scaffold + Modal Bottom Sheet
Or you can make you own, here’s an example implementation
And here’s how to use it
Just one clarification, if you decide to go with this answer (suggested by Benoit TH): Jetpack Compose Scaffold + Modal Bottom Sheet
You will need to use
ModalBottomSheetLayout
to have a bottom sheet with gray background above it like you showed in the example image provided.If you use the regular
BottomSheetScaffold
the behaviour is different, being the bottom sheet displayed without background on above it.EDIT:
Take into account that Material 3 removed these components (why google, why!?) so in case you want to use them (or you are migrating to Material 3), just copy the source code from Material into your project.
(that’s what I did, to be able to use
ModalBottomSheetLayout
in a project with Material 3)