Breadcrumb

Breadcrumb

HkBreadcrumb is the trail at the top of a page: a list of labels where every item but the last is a link back up the hierarchy, and the last one names the page the reader is on. It renders a <nav> wrapping an ordered list, so the trail is a landmark and the depth is in the markup rather than only in the layout.

  • The trail describes a position in a hierarchy — workspace, then group, then record. For the stack of open overlays, the strip that lists the window chain is ModalBreadcrumb, not this component.
  • Inside a page that already has several peer panels, switching between them is a tab strip, not a trail: a crumb points at an ancestor, a tab at a sibling.
  • This page is Vue-only. The Rust crate ships no mirror of HkBreadcrumb; its own Breadcrumb is an unrelated legacy component, documented on Breadcrumb (legacy), and is not a translation of this one.

Import

tsx
1
import { HkBreadcrumb } from "@celestia-island/hikari";

Items

items is required: an array of { label, to? }. An item without to renders as a <span> instead of an <a>, so a trail can name an intermediate level that has no page of its own without pretending it is a link — and the stylesheet only gives the pointer cursor, the hover fill and the press feedback to crumbs that really are links (&[href]), so a dead span never reads as a broken link.

TSX

Sizes

size picks one of three steps — sm, md (the default) and lg — which together set the font size, the gap between crumbs, the crumb's padding and the chevron's size. The size changes scale only; the structure and the item order are identical in all three, and there is no separate md rule because md is the base rhythm.

TSX

The current crumb and the separator

The last item is the current one: the stylesheet lifts it to the primary text colour, gives it medium weight and a soft glow, and makes it non-interactive (no pointer events), even when it carries a to. A trail may therefore spell its last entry exactly like the others; it reads as the page rather than as a link.

separator is declared as a string prop, but the component never reads it: the chevron between crumbs is fixed lucide markup, drawn between every pair and mirrored under [dir="rtl"]. Passing a string changes nothing, so a different divider is simply not available through this component — wrap the trail, or render your own list, when the divider must differ.

TSX

Both trails above render the same chevron: the separator value is not used.

API

Vue

Props

NameTypeDefaultRequired
itemsArray as PropType<{ label: string; to?: string }[]>—✓
separatorString——
size<code>String as PropType<"sm" | "md" | "lg"></code>"md"—

Accessibility

  • The root is a <nav>, which is a landmark, named from the library's translation table (hikari::breadcrumb.label, English "Breadcrumb"). The name is not settable per instance, so one document with several trails gets several landmarks of the same name.
  • The items are an ordered list, so the depth is available to assistive technology instead of being implied by the chevrons.
  • The current crumb is a <span>, not a link, and it carries no aria-current. It is read as an ordinary label: nothing tells a screen-reader user that this crumb names the page they are on. When that distinction matters, name the page in the surrounding heading as well.
  • Only crumb links are focusable, and the stylesheet draws the library's double focus ring for :focus-visible. The chevrons are decorative glyphs and add no focus stop.
  • The list wraps (flex-wrap), so a long path stays readable in a narrow column instead of overflowing; a wrapped trail reads in the same order, top to bottom.

Related components

  • NavItem — a single destination row; the vertical navigation a trail usually sits above.
  • NavSidebar — a whole navigation band built from those rows.
  • ModalBreadcrumb — the centred strip that lists a stack of open windows.
  • Sidebar — the scrollable panel for a long hierarchy, when the trail must show depth rather than one path.