CustomBottomSheet

fun CustomBottomSheet(scaffoldState: BottomSheetScaffoldState, offsetChanged: (Float) -> Unit, sheetPeekHeight: Dp, fadeColor: Color, sheetContent: @Composable () -> Unit)

Customizes the standard BottomSheetScaffold by modifying how the sheet's offset is calculated.

The offset is a value between 0 and 1:

  • 0: Indicates the bottom sheet is collapsed.

  • 1: Indicates the bottom sheet is fully visible.

The offset is also 0 if the bottom sheet is collapsed but remains visible due to its sheetPeekHeight.

The sheet layout adapts to the screen orientation:

  • In portrait mode, it occupies the full width of the screen.

  • In landscape mode, it occupies half the screen width and is aligned to the left side with 15px padding from the left.

Additionally, this implementation fades the background when the bottom sheet is expanded. Clicking the fader collapses the bottom sheet automatically.

Parameters

scaffoldState

Manages the state and behavior of the BottomSheetScaffold.

offsetChanged

Callback triggered when the collapse state changes.

sheetPeekHeight

The height of the bottom sheet when it is collapsed.

fadeColor

The color of the fade effect when the bottom sheet is expanded.

sheetContent

The composable content displayed inside the bottom sheet.