Skip to content

Breadcrumb

Hierarchical navigation trail with custom separators and truncation.

Data Display·Available inReactVueAngular·View as Markdown

Preview

tsx

Switch the framework picker (top-right of the panel) to render the same demo live in React, Vue, or Angular — same class names, ARIA, and visual output across all three.

Installation

Sisyphos UI ships unified packages for React, Vue, and Angular. Pick the one that matches your stack — every framework exports the same component classes, ARIA semantics, and CSS tokens.

$ pnpm add @sisyphos-ui/react

Then import the bundled stylesheet once at app entry: import "@sisyphos-ui/react/styles.css";

Usage

Idiomatic usage in each supported framework
import { Breadcrumb } from "@sisyphos-ui/react";

export const Crumbs = () => (
  <Breadcrumb
    items={[
      { label: "Home", href: "/" },
      { label: "Projects", href: "/projects" },
      { label: "Sisyphos UI" },
    ]}
  />
);

Collapsed middle

Set `maxItems` with `itemsBeforeCollapse` + `itemsAfterCollapse` to keep the trail compact on deep hierarchies.

tsx

With icons

Each item accepts an `icon` ReactNode.

tsx

Custom separator

Pass any ReactNode via `separator`.

tsx

API

PropTypeDefaultDescription
items*BreadcrumbItem[]Ordered entries (`label`, optional `href`, `onClick`, `icon`, `key`). The last item is treated as the current page.
separatorReactNode"/"Custom separator rendered between items.
maxItemsnumberCollapses middle items into an ellipsis when the total exceeds this count.
itemsBeforeCollapsenumber1Items kept before the ellipsis when collapsing.
itemsAfterCollapsenumber1Items kept after the ellipsis when collapsing.

The full API including refs, ARIA attributes, and HTML passthroughs lives in the package README on npm.

Accessibility

Adheres to the Breadcrumb WAI-ARIA design pattern.

  • Rendered inside a <nav aria-label="breadcrumb"> landmark wrapping an ordered list.
  • The last item is the current page — rendered as plain text with aria-current="page", never as a link.
  • Separators and the collapse ellipsis are aria-hidden="true", so screen readers announce only the trail items.
  • Middle items collapse behind maxItems without losing the first / last entries (itemsBeforeCollapse / itemsAfterCollapse).

Keyboard interactions

KeyAction
TabMoves focus through the breadcrumb links in trail order.
EnterActivates the focused link (or button, for `onClick`-only items).
Need more?View on npm →
Was this page helpful?