🌈 Create new beautiful Compose Gradients with our new wesite ->
Compose Component

WideNavigationRailItem

Material Design wide navigation rail item.

WideNavigationRailItem social preview

WideNavigationRailItem

Source set: Common
@Composable
public 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,
    indicatorPadding: PaddingValues =
        WideNavigationRailItemDefaults.indicatorPadding(railExpanded = railExpanded),
)

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 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.
indicatorPadding the spacing values to apply internally between the indicator and the indicator's content, if you need different paddings during expanded and collapsed states, use WideNavigationRailItemDefaults.indicatorPadding to correctly handle animations.

WideNavigationRailItem

Source set: Common
@Deprecated(
    message = "Deprecated in favor of function with indicatorPadding parameter",
    level = DeprecationLevel.HIDDEN,
)
@Composable
public 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,
): Unit

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