NavigationBarItem

Composable Component

Material Design navigation bar item.

Common
@Composable
fun RowScope.NavigationBarItem(
    selected: Boolean,
    onClick: () -> Unit,
    icon: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    label: @Composable (() -> Unit)? = null,
    alwaysShowLabel: Boolean = true,
    colors: NavigationBarItemColors = NavigationBarItemDefaults.colors(),
    interactionSource: MutableInteractionSource? = null,
)

Parameters

selectedwhether this item is selected
onClickcalled when this item is clicked
iconicon for this item, typically an Icon
modifierthe Modifier to be applied to this item
enabledcontrols the enabled state of this item. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.
labeloptional text label for this item
alwaysShowLabelwhether to always show the label for this item. If false, the label will only be shown when this item is selected.
colorsNavigationBarItemColors that will be used to resolve the colors used for this item in different states. See NavigationBarItemDefaults.colors.
interactionSourcean optional hoisted MutableInteractionSource for observing and emitting Interactions for this item. You can use this to change the item's appearance or preview the item in different states. Note that if null is provided, interactions will still happen internally.