StylishNavigationRailItem

fun StylishNavigationRailItem(selected: Boolean, onClick: () -> Unit, icon: @Composable () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, label: @Composable () -> Unit? = null, alwaysShowLabel: Boolean = true, colors: NavigationRailItemColors = NavigationRailItemDefaults.colors(), interactionSource: MutableInteractionSource? = null)

A single destination inside StylishNavigationRail, wrapping the Material 3 NavigationRailItem with M3 default colors.

Handles the selected-state indicator, disabled state, and semantics (selected / disabled) exactly like the M3 NavigationRailItem.

Parameters

selected

Whether this destination is currently selected.

onClick

Called when the destination is tapped.

icon

The icon slot, typically an Icon.

modifier

Modifier applied to the NavigationRailItem root.

enabled

When false, the destination ignores pointer input and renders in its disabled colors. Defaults to true.

label

Optional label slot rendered below icon. When null, the destination renders icon-only.

alwaysShowLabel

Whether to keep the label visible when the destination is not selected. Ignored when label is null. Defaults to true.

colors

NavigationRailItemColors resolving the item colors per state. Defaults to NavigationRailItemDefaults.colors.

interactionSource

Optional hoisted MutableInteractionSource for observing interactions. When null, one is remembered internally.

See also