Skip to content

Breadcrumbs

In review
Live · web

Trail: leading glyphs, current crumb marked & non-interactive

Deep path: middle collapses into a keyboard-openable “…” menu

Truncation: width-capped, the current crumb ellipsizes

Mobile: phone-narrow container auto-collapses to first + “…” + current

Last crumb navigated: none yet. The island is live. Tab the crumbs; open “…” with Enter/Space, arrow through it, Esc to close. The mobile fold keeps every ancestor reachable through the same menu.

// Web: React, consuming @dizyx/nockerl-tokens. Breadcrumbs are a web-leaning
// pattern (neither shipped app has one), so this is the intended API, not yet
// exported from @dizyx/nockerl-react (promotion tracked).
export function FilePathTrail() {
return (
<Breadcrumbs
collapseAfter={2}
onNavigate={(label) => router.push(label)}
items={[
{ label: 'dizyx', href: '/w/dizyx', icon: 'root' },
{ label: 'nockerl-design', href: '/w/dizyx/nockerl-design', icon: 'folder' },
{ label: 'site', href: '#', icon: 'folder' },
{ label: 'src', href: '#', icon: 'folder' },
{ label: 'BreadcrumbsDemo.tsx', icon: 'file' }, // no href → current page
]}
/>
);
}
PropTypeDefaultDescription
items *Crumb[]Ordered path, root → current. Each Crumb is { label, href?, icon? }. The last item is the current page: omit its href and it renders non-interactive with aria-current="page".
collapseAfternumberWhen set and the trail is deeper than collapseAfter + 2, keeps the first crumb + this many trailing crumbs and folds the middle into a keyboard-openable menu.
cappedbooleanfalseCaps the trail width so the current crumb ellipsizes instead of overflowing the chrome bar.
onNavigate(label: string) => voidFired when an ancestor crumb (or an item in the overflow menu) is activated. The current crumb never fires it.
icon'root' | 'folder' | 'task' | 'file'Per-Crumb leading glyph. Echoes the apps: root (workspace), folder (project), task, file.