StylishNavigationBar

fun StylishNavigationBar(items: List<StylishNavigationItem>, modifier: Modifier = Modifier, labelStyle: TextStyle = MaterialTheme.typography.labelSmall, iconSize: Dp = 24.dp, containerColor: Color = MaterialTheme.colorScheme.surfaceContainer, selectedContentColor: Color = MaterialTheme.colorScheme.primary, unselectedContentColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, disabledContentColor: Color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.38f), alwaysShowLabel: Boolean = true, labelMaxLines: Int = 1, labelOverflow: TextOverflow = TextOverflow.Ellipsis, windowInsets: WindowInsets = WindowInsets.navigationBars)

A bottom navigation bar that displays a row of StylishNavigationItem destinations. Each destination shows an icon, a label, and an optional badge. The selected destination is highlighted with an animated pill behind its icon and the primary content color.

The bar renders inside a Surface with containerColor so it gets a background and a minimum height of 80.dp, and consumes windowInsets (defaulting to the navigation-bar insets) so it clears the system gesture area. When alwaysShowLabel is false, the label of unselected destinations is hidden and only the selected destination keeps its label visible.

Designed to be placed inside the bottomBar slot of com.segnities007.stylishui.components.patterns.StylishScaffold or within a com.segnities007.stylishui.components.patterns.StylishFooter.

Parameters

items

The navigation destinations to display.

modifier

Modifier applied to the root Surface.

labelStyle

TextStyle applied to each destination label. Defaults to MaterialTheme.typography.labelSmall.

iconSize

Size of each destination icon. Defaults to 24 dp.

containerColor

Background color of the bar. Defaults to MaterialTheme.colorScheme.surfaceContainer.

selectedContentColor

Content color for the selected destination. Defaults to MaterialTheme.colorScheme.primary. Also used as the base tint of the selection pill behind the icon.

unselectedContentColor

Content color for unselected destinations. Defaults to MaterialTheme.colorScheme.onSurfaceVariant.

disabledContentColor

Content color for disabled destinations. Defaults to MaterialTheme.colorScheme.onSurface at 38 % alpha.

alwaysShowLabel

When true (the default), every destination shows its label. When false, only the selected destination shows its label; unselected destinations render icon-only.

labelMaxLines

Maximum lines for each destination label.

labelOverflow

Overflow strategy for labels.

windowInsets

WindowInsets consumed by the bar via Modifier.windowInsetsPadding. Defaults to WindowInsets.navigationBars so content stays clear of the system navigation bar.

Accessibility

Each destination is exposed with Role.Tab semantics, marks StylishNavigationItem.selected via the selected semantics and StylishNavigationItem.enabled via the disabled semantics, so screen readers announce the selection and disabled states. The selection-pill cross-fade honors the system reduced-motion setting (see isStylishReducedMotionEnabled) by snapping instead of tweening.

See also