API reference

SideNavItem Composable

Displays a destination in persistent side-rail navigation.
Use collapsed for icon-only rails and dense for compact rows. Expanded rows can show a secondary label while collapsed rows remain at least a 48dp icon target.

Signature

@Composable
fun SideNavItem(
    icon: @Composable () -> Unit,
    onClick: () -> Unit,
    primaryLabel: String,
    modifier: Modifier = Modifier,
    secondaryLabel: String? = null,
    collapsed: Boolean = false,
    dense: Boolean = false,
    showExpandedIcon: Boolean = true,
    selected: Boolean = false,
    enabled: Boolean = true,
    colors: SideNavItemColors = SideNavItemDefaults.Colors,
    dimensions: NavigationDimensions = UiSetTheme.dimensions.navigation,
    primaryTextStyle: TextStyle = UiSetTheme.typography.body,
    secondaryTextStyle: TextStyle = UiSetTheme.typography.bodySmall,
    interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
    indication: UiSetIndicationSpec? = UiSetTheme.indications.subtle.default,
)

Parameters

icon: @Composable () -> Unit destination icon
onClick: () -> Unit callback invoked when the destination is selected
primaryLabel: String destination name
modifier: Modifier modifier applied to the navigation item's outer layout
secondaryLabel: String? optional supporting destination text
collapsed: Boolean whether to render an icon-only rail item
dense: Boolean whether to use the compact visual height
showExpandedIcon: Boolean whether expanded rows include icon
selected: Boolean whether this destination represents the current screen
enabled: Boolean whether the destination accepts input
colors: SideNavItemColors colors for selected, unselected, and disabled states
dimensions: NavigationDimensions row heights, icon size, padding, and spacing
primaryTextStyle: TextStyle style for primaryLabel
secondaryTextStyle: TextStyle style for secondaryLabel
interactionSource: MutableInteractionSource interaction stream shared with callers observing hover, focus, or press
indication: UiSetIndicationSpec? interaction feedback split around the navigation item clipping boundary