Object

WideNavigationRailItemDefaults

Defaults used in WideNavigationRailItem.

Source set: Common

Added in 1.5.0-alpha17

object WideNavigationRailItemDefaults

Defaults used in WideNavigationRailItem.

Properties

IndicatorCollapsedPadding

Source set: Common

Added in 1.5.0-alpha17

val IndicatorCollapsedPadding =
    PaddingValues(
        horizontal = ItemTopIconIndicatorHorizontalPadding,
        vertical = ItemTopIconIndicatorVerticalPadding,
    )

The default padding to be applied when the associated WideNavigationRailItem is collapsed.

IndicatorExpandedPadding

Source set: Common

Added in 1.5.0-alpha17

val IndicatorExpandedPadding =
    PaddingValues(
        horizontal = NavigationRailHorizontalItemTokens.FullWidthLeadingSpace,
        vertical = ItemStartIconIndicatorVerticalPadding,
    )

The default padding to be applied when the associated WideNavigationRailItem is expanded.

Functions

indicatorPadding

Added in 1.5.0-alpha17

@Composable
    fun indicatorPadding(
        railExpanded: Boolean,
        collapsedPadding: PaddingValues = IndicatorCollapsedPadding,
        expandedPadding: PaddingValues = IndicatorExpandedPadding,
    ): PaddingValues

The default indicator padding of a WideNavigationRailItem.

Parameters

collapsedPadding the padding to be applied when the associated WideNavigationRail is collapsed
expandedPadding the padding to be applied when the associated WideNavigationRail is expanded
railExpanded whether the associated WideNavigationRail is expanded or collapsed

iconPositionFor

Added in 1.5.0-alpha17

fun iconPositionFor(railExpanded: Boolean) =
        if (railExpanded) NavigationItemIconPosition.Start else NavigationItemIconPosition.Top

The default icon position of a WideNavigationRailItem given whether the associated WideNavigationRail is collapsed or expanded.

colors

Added in 1.5.0-alpha17

@Composable fun colors() = MaterialTheme.colorScheme.defaultWideNavigationRailItemColors

Creates a NavigationItemColors with the provided colors according to the Material specification.

colors

Added in 1.5.0-alpha17

@Composable
    fun colors(
        selectedIconColor: Color = NavigationRailColorTokens.ItemActiveIcon.value,
        selectedTextColor: Color = NavigationRailColorTokens.ItemActiveLabelText.value,
        selectedIndicatorColor: Color = NavigationRailColorTokens.ItemActiveIndicator.value,
        unselectedIconColor: Color = NavigationRailColorTokens.ItemInactiveIcon.value,
        unselectedTextColor: Color = NavigationRailColorTokens.ItemInactiveLabelText.value,
        disabledIconColor: Color = unselectedIconColor.copy(alpha = DisabledAlpha),
        disabledTextColor: Color = unselectedTextColor.copy(alpha = DisabledAlpha),
    ): NavigationItemColors

Creates a NavigationItemColors with the provided colors according to the Material specification.

Parameters

selectedIconColor the color to use for the icon when the item is selected.
selectedTextColor the color to use for the text label when the item is selected.
selectedIndicatorColor the color to use for the indicator when the item is selected.
unselectedIconColor the color to use for the icon when the item is unselected.
unselectedTextColor the color to use for the text label when the item is unselected.
disabledIconColor the color to use for the icon when the item is disabled.
disabledTextColor the color to use for the text label when the item is disabled.

Returns

the resulting NavigationItemColors used for WideNavigationRailItem