NavigationSuiteItem

Functions summary

Unit
@Composable
NavigationSuiteItem(
    selected: Boolean,
    onClick: () -> Unit,
    icon: @Composable () -> Unit,
    label: (@Composable () -> Unit)?,
    modifier: Modifier,
    navigationSuiteType: NavigationSuiteType,
    enabled: Boolean,
    badge: (@Composable () -> Unit)?,
    colors: NavigationItemColors?,
    interactionSource: MutableInteractionSource?
)

The default Material navigation item component according to the current NavigationSuiteType to be used with the NavigationSuite that accepts this function.

Cmn

Functions

@Composable
fun NavigationSuiteItem(
    selected: Boolean,
    onClick: () -> Unit,
    icon: @Composable () -> Unit,
    label: (@Composable () -> Unit)?,
    modifier: Modifier = Modifier,
    navigationSuiteType: NavigationSuiteType = NavigationSuiteScaffoldDefaults.navigationSuiteType(WindowAdaptiveInfoDefault),
    enabled: Boolean = true,
    badge: (@Composable () -> Unit)? = null,
    colors: NavigationItemColors? = null,
    interactionSource: MutableInteractionSource? = null
): Unit

The default Material navigation item component according to the current NavigationSuiteType to be used with the NavigationSuite that accepts this function.

For specifics about each navigation component, see ShortNavigationBarItem, WideNavigationRailItem, NavigationRailItem, and NavigationDrawerItem.

Parameters
selected: Boolean

whether this item is selected

onClick: () -> Unit

called when this item is clicked

icon: @Composable () -> Unit

icon for this item, typically an Icon

label: (@Composable () -> Unit)?

the text label for this item

modifier: Modifier = Modifier

the Modifier to be applied to this item

navigationSuiteType: NavigationSuiteType = NavigationSuiteScaffoldDefaults.navigationSuiteType(WindowAdaptiveInfoDefault)

the current NavigationSuiteType of the associated NavigationSuite. Defaults to NavigationSuiteScaffoldDefaults.navigationSuiteType

enabled: Boolean = true

controls 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. Note: as of now, for NavigationDrawerItem, this is always true.

badge: (@Composable () -> Unit)? = null

optional badge to show on this item

colors: NavigationItemColors? = null

NavigationItemColors that will be used to resolve the colors used for this item in different states. If null, a default Material colors for each specific item will be used.

interactionSource: MutableInteractionSource? = null

an 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.