Breadcrumb · trail

A trail that grows and shrinks with a slide, folds what doesn't fit into a “…” menu, and can offer a crumb's siblings in a switcher — with four separators and three looks.

A live trail · home icon · project switcher

Folding · maxItems 4 · or the width — drag the box's corner

Separators · looks

Usage

JavaScript
import { signal } from "./index.js";import { Breadcrumb } from "./components/breadcrumb.js"; // items: [{ label, onClick? / href?, icon?, id?, menu? }] — the last is the current pageBreadcrumb({ items: [  { label: "Home", href: "/" },  { label: "Components", href: "/components" },  { label: "Breadcrumb" },], navigate })                        // hrefs go through your router // a signal / getter: crumbs added later slide in; id keeps a crumb as it isconst path = signal(["src", "components"]);Breadcrumb({ items: () => path().map((seg, i) => ({ id: path().slice(0, i + 1).join("/"), label: seg,  onClick: () => path.set(path().slice(0, i + 1)) })) }) // ▾ beside a crumb: its siblings (a project switcher){ label: "kartex", menu: [{ label: "deck-site", onClick: switchTo }, …] } // folding: at most maxItems, and whatever doesn't fit the width, go into "…"Breadcrumb({ items, maxItems: 4, itemsBefore: 1, itemsAfter: 2 })Breadcrumb({ items, separator: "slash" | "dot" | "arrow", variant: "pill" | "contained", home: true })