WideNavigationRailItem
Composable Component
Material Design wide navigation rail item.
Common
@Composable
fun WideNavigationRailItem(
selected: Boolean,
onClick: () -> Unit,
icon: @Composable () -> Unit,
label: @Composable (() -> Unit)?,
railExpanded: Boolean,
modifier: Modifier = Modifier,
enabled: Boolean = true,
iconPosition: NavigationItemIconPosition =
WideNavigationRailItemDefaults.iconPositionFor(railExpanded),
colors: NavigationItemColors = WideNavigationRailItemDefaults.colors(),
interactionSource: MutableInteractionSource? = null,
)
Parameters
selected | whether this item is selected |
onClick | called when this item is clicked |
icon | icon for this item, typically an Icon |
label | text label for this item |
railExpanded | whether the associated WideNavigationRail is expanded or collapsed |
modifier | the Modifier to be applied to this item |
enabled | 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. |
iconPosition | the NavigationItemIconPosition for the icon |
colors | NavigationItemColors that will be used to resolve the colors used for this item in different states. See WideNavigationRailItemDefaults.colors |
interactionSource | an optional hoisted MutableInteractionSource for observing and emitting Interaction s 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. |
Common
Deprecated Deprecated in favor of function with required railExpanded parameter
@Composable
fun WideNavigationRailItem(
selected: Boolean,
onClick: () -> Unit,
icon: @Composable () -> Unit,
label: @Composable (() -> Unit)?,
modifier: Modifier = Modifier,
enabled: Boolean = true,
railExpanded: Boolean = false,
iconPosition: NavigationItemIconPosition =
WideNavigationRailItemDefaults.iconPositionFor(railExpanded),
colors: NavigationItemColors = WideNavigationRailItemDefaults.colors(),
interactionSource: MutableInteractionSource? = null,
) =
WideNavigationRailItem(
selected,
onClick,
icon,
label,
railExpanded,
modifier,
enabled,
iconPosition,
colors,
interactionSource,
)
Parameters
selected | whether this item is selected |
onClick | called when this item is clicked |
icon | icon for this item, typically an Icon |
label | text label for this item |
modifier | the Modifier to be applied to this item |
enabled | 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. |
railExpanded | whether the associated WideNavigationRail is expanded or collapsed |
iconPosition | the NavigationItemIconPosition for the icon |
colors | NavigationItemColors that will be used to resolve the colors used for this item in different states. See WideNavigationRailItemDefaults.colors |
interactionSource | an optional hoisted MutableInteractionSource for observing and emitting Interaction s 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. |
Create your own Component Library
Material Components are meant to be used as is and they do not allow customizations. To build your own Jetpack Compose component library use Compose Unstyled