CustomBottomSheet

fun CustomBottomSheet(state: CustomBottomSheetState = rememberCustomBottomSheetState(), onVisibilityChanged: (CustomBottomSheetVisibility) -> Unit, sheetPeekHeight: Dp, fadeColor: Color?, landscapeHorizontalPadding: Dp, sheetContent: @Composable () -> Unit)

Customizes the standard BottomSheetScaffold by adding calculation of visible height.

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 configurable horizontal padding.

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

Parameters

state

Manages the state and behavior of the BottomSheetScaffold.

onVisibilityChanged

Callback invoked when the bottom sheet visibility 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.

landscapeHorizontalPadding

The horizontal padding applied to the bottom sheet in landscape mode.

sheetContent

The composable content displayed inside the bottom sheet.