Skip to content
Kappa
Breadcrumbs
@dicehub/kappav1.0.0

Breadcrumbs

Shows the current resource inside an ordered hierarchy of ancestor links.

Installation

Barrel

import {
  Breadcrumbs,
  BreadcrumbsCurrent,
} from "@dicehub/kappa";

Granular

import {
  Breadcrumbs,
  BreadcrumbsCurrent,
  BreadcrumbsEllipsis,
  BreadcrumbsItem,
  BreadcrumbsLink,
  BreadcrumbsList,
  BreadcrumbsPage,
  BreadcrumbsRoot,
  BreadcrumbsSeparator,
} from "@dicehub/kappa/components/breadcrumbs";

Usage

Root renders a labelled navigation landmark and List preserves hierarchy as an ordered list. Use Link with a real destination for each level, including the current page. Setaria-current="page" on the current link for its accessible state and bold style. Page and its Current alias remain available when the current location has no link.

Composition

Typical part hierarchy
Breadcrumbs.Root
└── Breadcrumbs.List
    ├── Breadcrumbs.Item
    │   └── Breadcrumbs.Link
    ├── Breadcrumbs.Separator
    ├── Breadcrumbs.Ellipsis
    └── Breadcrumbs.Item
        └── Breadcrumbs.Page / Breadcrumbs.Current

Root creates the navigation landmark. List and Item preserve the ordered hierarchy. Alternate links with decorative separators. Separator renders / by default. Links underline on hover and show an outline on press or keyboard focus. These styles come from Kappa and require no application overrides.

Examples

Basic

Link each level and mark the final link with aria-current="page". Native links support Tab, Enter, copying the address, and opening in a new tab.

Custom Separator

Replace the default slash through Separator's default slot. This example also uses Page for a noninteractive current location; Current is an alias of Page.

Sizes

Use sm for 12px text in dense toolbars and base for 14px text in standard page context.

With Icons

Place decorative SVG beside visible labels. Do not replace every label with an icon.

Long and Wrapping

Trails wrap without horizontal overflow. Preserve the full current location; collapse known ancestors when the surrounding layout requires a shorter trail.

Collapsed

Ellipsis is a decorative indicator only. It does not measure, hide, or automatically collapse items; application code chooses which known ancestors to omit.

Collapsed Ancestor Menu

Use Dropdown to show hidden ancestors. Give its trigger an accessible name and use link items for destinations.

Use asChild so Link styles and attributes merge onto a router's semantic anchor.

Right-to-left

Logical flow reverses the trail. The slash separator works in both directions.

Accessibility

  • Give each trail a concise aria-label or aria-labelledby; Root defaults to “Breadcrumb”.
  • Use real links and mark exactly one current location with aria-current="page". Page or Current provides a noninteractive span when the current location has no destination.
  • Separators and Ellipsis are decorative and hidden from assistive technology.
  • Breadcrumbs add no arrow-key model. Native links use the normal Tab order and Enter activation.
  • A collapsed ancestor trigger needs an accessible name and a real Menu with managed focus, Escape, and outside-dismiss behavior.
  • Keep a visible focus indicator and do not depend on separator shape or color to communicate hierarchy.

See the WAI-ARIA Breadcrumb Patternand Ark UI Menu guidance.

API Reference

Root

Forwards native navigation attributes, listeners, ARIA properties, and data attributes.

PropTypeDefaultDescription
size"sm" | "base""base"Trail density.

Forwards native anchor attributes and listeners. Use href for a native anchor or asChild with a router component that renders one anchor. Setaria-current="page" on the link for the current location.

PropTypeDefaultDescription
hrefstring—Native destination. Required when Link renders its own anchor.
asChildbooleanfalseMerges Link attributes and styling onto one child anchor, such as RouterLink.

Parts

PartElementDescription
RootnavLabelled navigation landmark; forwards native nav attributes.
ListolOrdered hierarchy of breadcrumb items.
ItemliWraps one link, current page, ellipsis, or composed control.
LinkaAncestor or current-page link; supports aria-current and asChild for router-link composition.
Page / CurrentspanNoninteractive current location with aria-current=page.
SeparatorliDecorative slash separator, hidden from assistive technology; replaceable through its default slot.
EllipsisspanDecorative collapsed-state indicator; it does not hide items by itself.

Exports

ExportDescription
BreadcrumbsCompound root with Root, List, Item, Link, Page, Current, Separator, and Ellipsis.
BreadcrumbsRootUnaugmented root component.
BreadcrumbsListOrdered-list part.
BreadcrumbsItemList-item part.
BreadcrumbsLinkAncestor or current-page link part.
BreadcrumbsPageCurrent-page part.
BreadcrumbsCurrentAlias of BreadcrumbsPage.
BreadcrumbsSeparatorDecorative separator part.
BreadcrumbsEllipsisDecorative ellipsis part.
BREADCRUMBS_SIZESSupported root-size values.
BREADCRUMBS_DEFAULT_SIZEDefault root size.
isBreadcrumbsSize / resolveBreadcrumbsSizeRuntime size guard and resolver.
Breadcrumbs*Props / Breadcrumbs*SlotsPublic root and part TypeScript contracts.