Breadcrumb
nav + ol trail primitives with a page anchor and a collapsed-ellipsis hook for DropdownMenu.
Breadcrumb renders the location trail: nav with an accessible name, an
ol list, links for intermediate hops, and the current page as a
non-clickable anchor with aria-current.
Installation
import {
Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink,
BreadcrumbPage, BreadcrumbSeparator,
} from "@iammikz/srui";
Usage
Router links and custom separators
asChild on a BreadcrumbLink renders its single child instead of a plain
anchor — a router <Link> in an SPA, or any <a> — with the link styling
kept; giving a BreadcrumbSeparator children replaces the default chevron:
Exports
| Export | Notes |
|---|---|
Breadcrumb | nav wrapper with aria-label="Breadcrumb" |
BreadcrumbList / BreadcrumbItem | The ol/li structure |
BreadcrumbLink | Intermediate hops (anchor props); asChild renders a router <Link> instead |
BreadcrumbPage | Current page — aria-current="page", not focusable |
BreadcrumbSeparator | Decorative chevron; children replace it |
BreadcrumbEllipsis | Collapsed-trail affordance — pair with DropdownMenu; children replace the … |
Accessibility
The trail is a labelled nav with an ordered list; separators and the
ellipsis are hidden from assistive tech so only the trail itself is
announced, ending at aria-current="page".
Upgrades over the PRUI original: the ellipsis composes with DropdownMenu
to disclose the hidden middle of long trails in one click.