Start native apps faster with the Composables CLI ->
Class

BottomSheetNavigator

Navigator that drives a ModalBottomSheetState for use of ModalBottomSheetLayouts with the navigation library.

Source set: Common
public class BottomSheetNavigator(internal val sheetState: ModalBottomSheetState) :
    Navigator<BottomSheetNavigator.Destination>()

Navigator that drives a ModalBottomSheetState for use of ModalBottomSheetLayouts with the navigation library. Every destination using this Navigator must set a valid Composable by setting it directly on an instantiated Destination or calling androidx.compose.material.navigation.bottomSheet.

The sheetContent Composable will always host the latest entry of the back stack. When navigating from a BottomSheetNavigator.Destination to another BottomSheetNavigator.Destination, the content of the sheet will be replaced instead of a new bottom sheet being shown.

When the sheet is dismissed by the user, the state's NavigatorState.backStack will be popped.

Parameters

sheetState The ModalBottomSheetState that the BottomSheetNavigator will use to drive the sheet state

Properties

Source set: Common
public val navigatorSheetState: BottomSheetNavigatorSheetState =
        BottomSheetNavigatorSheetState(sheetState)

Access properties of the ModalBottomSheetLayout's ModalBottomSheetState

Functions

onAttach

Source set: Common
override fun onAttach(state: NavigatorState)

createDestination

Source set: Common
override fun createDestination(): Destination
Source set: Common
override fun navigate(
        entries: List<NavBackStackEntry>,
        navOptions: NavOptions?,
        navigatorExtras: Extras?,
    )

popBackStack

Source set: Common
override fun popBackStack(popUpTo: NavBackStackEntry, savedState: Boolean)

Members

Destination

Source set: Common
public class Destination(
        navigator: BottomSheetNavigator,
        internal val content: @Composable ColumnScope.(NavBackStackEntry) -> Unit,
    ) : NavDestination(navigator), FloatingWindow

NavDestination specific to BottomSheetNavigator.

Parameters

navigator The navigator used to navigate to this destination
content The content to be displayed for this destination