Skip to main content

Module breadcrumb

Module breadcrumb 

Source
Expand description

Breadcrumb — a navigational trail with automatic overflow into a menu.

Breadcrumb renders a horizontal row of labelled segments separated by chevron glyphs, representing a hierarchical path (file system, settings hierarchy, wizard steps, etc.). When the trail is too wide to fit its container, middle segments are automatically collapsed into a popover menu — the root and the current (last) segment always stay visible, matching Windows Explorer, macOS path bar, and web breadcrumb conventions.

§Building a trail

let _bc = Breadcrumb::new()
    .item(BreadcrumbItem::new(lit!("Home"))
        .on_activate_fn(|ctx| ctx.send_intent(Intent::new("app.nav.home"))))
    .item(BreadcrumbItem::new(lit!("Projects"))
        .on_activate_fn(|ctx| ctx.send_intent(Intent::new("app.nav.projects"))))
    .item(BreadcrumbItem::current(lit!("Teksilo")));

§Accessibility

The container uses Role::Navigation; each segment uses Role::Link. The current crumb sets aria-current="page". The decorative separator chevrons are hidden from the AT tree. The overflow button declares HasPopup::Menu.

Structs§

Breadcrumb
A breadcrumb navigation row with automatic overflow: when the trail is too wide, the middle crumbs collapse into a trailing-of-root menu while the root and the current (last) crumb stay visible — the standard breadcrumb collapse (Windows Explorer / web breadcrumbs / macOS path bar).
BreadcrumbItem
A single breadcrumb segment definition.

Constants§

BREADCRUMB_CORNER_RADIUS
Corner radius of the interactive segment hover/focus rectangle.
BREADCRUMB_ITEM_HEIGHT
Minimum height of a single breadcrumb segment in logical pixels.
BREADCRUMB_ITEM_PADDING_HORIZONTAL
Horizontal inner padding of each segment pill in logical pixels.
BREADCRUMB_SEPARATOR_GAP
Gap reserved for the chevron separator between adjacent segments.