BreadcrumbBar

fun BreadcrumbBar(items: List<BreadcrumbItem>, onItemClick: (Int) -> Unit, modifier: Modifier = Modifier, highlightIndex: Int = items.lastIndex, enabled: Boolean = true, colors: BreadcrumbBarColors = BreadcrumbBarDefaults.breadcrumbBarColors(), insideMargin: PaddingValues = BreadcrumbBarDefaults.InsideMargin, itemMaxWidth: Dp = BreadcrumbBarDefaults.ItemMaxWidth, scrollState: ScrollState? = null, interactionSource: MutableInteractionSource? = null, indication: Indication? = LocalIndication.current)

A horizontal breadcrumb navigation bar with Miuix style. Displays a trail of path segments as capsule-shaped items separated by arrow icons. When the content overflows the available width, it scrolls horizontally instead of collapsing — matching the file-manager convention on mobile devices.

The highlightIndex is decoupled from the items list: the caller may show the full path while highlighting any segment (e.g. the current directory or a parent the user navigated back to).

Parameters

items

The list of BreadcrumbItems to display.

onItemClick

Callback invoked with the index of the clicked item.

modifier

The modifier to be applied to the BreadcrumbBar.

highlightIndex

The index of the highlighted item. Defaults to the last item. Pass a negative value (e.g. -1) to disable highlighting and auto-scroll entirely.

enabled

Whether the items are clickable. When disabled, items use the disabled color scheme but horizontal scrolling remains active.

insideMargin

The margin inside the BreadcrumbBar.

itemMaxWidth

The maximum width of each capsule-shaped item. Text beyond this is truncated.

scrollState

The ScrollState to be used for horizontal scrolling. If null, an internal state is created. Pass an externally hoisted state to preserve scroll position across recompositions.

interactionSource

The MutableInteractionSource to be used for the items.

indication

The Indication to be used for click interactions.