ModalDrawerSheet

Functions summary

Unit
@Composable
ModalDrawerSheet(
    modifier: Modifier,
    drawerShape: Shape,
    drawerContainerColor: Color,
    drawerContentColor: Color,
    drawerTonalElevation: Dp,
    windowInsets: WindowInsets,
    content: @Composable ColumnScope.() -> Unit
)

Content inside of a modal navigation drawer.

Cmn
Unit
@Composable
ModalDrawerSheet(
    drawerState: DrawerState,
    modifier: Modifier,
    drawerShape: Shape,
    drawerContainerColor: Color,
    drawerContentColor: Color,
    drawerTonalElevation: Dp,
    windowInsets: WindowInsets,
    content: @Composable ColumnScope.() -> Unit
)

Content inside of a modal navigation drawer.

Cmn

Functions

ModalDrawerSheet

@Composable
fun ModalDrawerSheet(
    modifier: Modifier = Modifier,
    drawerShape: Shape = DrawerDefaults.shape,
    drawerContainerColor: Color = DrawerDefaults.modalContainerColor,
    drawerContentColor: Color = contentColorFor(drawerContainerColor),
    drawerTonalElevation: Dp = DrawerDefaults.ModalDrawerElevation,
    windowInsets: WindowInsets = DrawerDefaults.windowInsets,
    content: @Composable ColumnScope.() -> Unit
): Unit

Content inside of a modal navigation drawer.

Note: This version of ModalDrawerSheet does not handle back by default. For automatic back handling and predictive back animations on Android 14+, use the ModalDrawerSheet that accepts drawerState as a param.

Parameters
modifier: Modifier = Modifier

the Modifier to be applied to this drawer's content

drawerShape: Shape = DrawerDefaults.shape

defines the shape of this drawer's container

drawerContainerColor: Color = DrawerDefaults.modalContainerColor

the color used for the background of this drawer. Use Color.Transparent to have no color.

drawerContentColor: Color = contentColorFor(drawerContainerColor)

the preferred color for content inside this drawer. Defaults to either the matching content color for drawerContainerColor, or to the current LocalContentColor if drawerContainerColor is not a color from the theme.

drawerTonalElevation: Dp = DrawerDefaults.ModalDrawerElevation

when drawerContainerColor is ColorScheme.surface, a translucent primary color overlay is applied on top of the container. A higher tonal elevation value will result in a darker color in light theme and lighter color in dark theme. See also: Surface.

windowInsets: WindowInsets = DrawerDefaults.windowInsets

a window insets for the sheet.

content: @Composable ColumnScope.() -> Unit

content inside of a modal navigation drawer

ModalDrawerSheet

@Composable
fun ModalDrawerSheet(
    drawerState: DrawerState,
    modifier: Modifier = Modifier,
    drawerShape: Shape = DrawerDefaults.shape,
    drawerContainerColor: Color = DrawerDefaults.modalContainerColor,
    drawerContentColor: Color = contentColorFor(drawerContainerColor),
    drawerTonalElevation: Dp = DrawerDefaults.ModalDrawerElevation,
    windowInsets: WindowInsets = DrawerDefaults.windowInsets,
    content: @Composable ColumnScope.() -> Unit
): Unit

Content inside of a modal navigation drawer.

Note: This version of ModalDrawerSheet requires a drawerState to be provided and will handle back by default for all Android versions, as well as animate during predictive back on Android 14+.

Parameters
drawerState: DrawerState

state of the drawer

modifier: Modifier = Modifier

the Modifier to be applied to this drawer's content

drawerShape: Shape = DrawerDefaults.shape

defines the shape of this drawer's container

drawerContainerColor: Color = DrawerDefaults.modalContainerColor

the color used for the background of this drawer. Use Color.Transparent to have no color.

drawerContentColor: Color = contentColorFor(drawerContainerColor)

the preferred color for content inside this drawer. Defaults to either the matching content color for drawerContainerColor, or to the current LocalContentColor if drawerContainerColor is not a color from the theme.

drawerTonalElevation: Dp = DrawerDefaults.ModalDrawerElevation

when drawerContainerColor is ColorScheme.surface, a translucent primary color overlay is applied on top of the container. A higher tonal elevation value will result in a darker color in light theme and lighter color in dark theme. See also: Surface.

windowInsets: WindowInsets = DrawerDefaults.windowInsets

a window insets for the sheet.

content: @Composable ColumnScope.() -> Unit

content inside of a modal navigation drawer