State of Compose 2023 results are in! Click here to learn more

← Back to Material 3 Compose

NavigationDrawerItem

Component
in
Material 3
. Since 1.0.0

Overview

Code Examples

Video

Material Design navigation drawer item.

A NavigationDrawerItem represents a destination within drawers, either ModalNavigationDrawer, PermanentNavigationDrawer or DismissibleNavigationDrawer.

Overloads

@Composable
fun NavigationDrawerItem(
    label: @Composable () -> Unit,
    selected: Boolean,
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    icon: (@Composable () -> Unit)? = null,
    badge: (@Composable () -> Unit)? = null,
    shape: Shape = NavigationDrawerTokens.ActiveIndicatorShape.toShape(),
    colors: NavigationDrawerItemColors = NavigationDrawerItemDefaults.colors(),
    interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }
)

Parameters

NameDescription
labeltext label for this item
selectedwhether this item is selected
onClickcalled when this item is clicked
modifierthe Modifier to be applied to this item
iconoptional icon for this item, typically an Icon
badgeoptional badge to show on this item from the end side
colorsNavigationDrawerItemColors that will be used to resolve the colors used for this item in different states. See NavigationDrawerItemDefaults.colors.
interactionSourcethe MutableInteractionSource representing the stream of Interactions for this item. You can create and pass in your own remembered instance to observe Interactions and customize the appearance / behavior of this item in different states