Bottom Sheet
class BottomSheet(
override val content: @Composable () -> Unit
) : NavigationNode {
..
var bottomSheetOptions by mutableStateOf(BottomSheetOptions())
..
}data class BottomSheetOptions(
val scrimColor: Color? = null,
val confirmStateChange: (value: BottomSheetValue) -> Boolean = { true },
val dismissOnClickOutside: Boolean = true,
val onOutsideClick: () -> Unit = {}
)Updating BottomSheet state
@Composable
fun MyBottomSheet() {
val bottomSheet = requireLocalBottomSheet() // Get the local bottom sheet node
var scrimColor by remember { mutableStateOf(Color.Back) }
LaunchedEffect(scrimColor) {
bottomSheet.bottomSheetOptions = bottomSheet.bottomSheetOptions.copy(
scrimColor = scrimColor
)
}
Button(onClick = {
scrimColor = if (scrimColor == Color.Black) {
Color.White
} else {
Color.Black
}
}) {
Text(text = "Toggle Scrim!")
}
}

Last updated