NavigationBarItem
Material Design navigation bar item.
Navigation bars offer a persistent and convenient way to switch between main destinations in an app.
The recommended configuration for a NavigationBarItem depends on how many items there are inside a NavigationBar:
Three destinations: Display icons and text labels for all destinations.
Four destinations: Active destinations display an icon and text label. Inactive destinations display icons, and text labels are recommended.
Five destinations: Active destinations display an icon and text label. Inactive destinations use icons, and use text labels if space permits.
A NavigationBarItem always shows text labels (if it exists) when selected. Showing text labels if not selected is controlled by alwaysShowLabel.
Parameters
whether this item is selected
called when this item is clicked
icon for this item
the Modifier to be applied to this item
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.
optional text label for this item
whether to always show the label for this item. If false
, the label will only be shown when this item is selected.
the MutableInteractionSource representing the stream of Interactions for this item. You can create and pass in your own remember
ed instance to observe Interactions and customize the appearance / behavior of this item in different states.