Skip to content

GhostBreadcrumb ​

GhostBreadcrumb implements the WAI-ARIA APG breadcrumb pattern with compound list, item, link, page, separator, and ellipsis parts. Import the parts from @ghostvue/themes for the default trail styling. For unstyled markup with your own CSS, see Advanced: headless composition.

Show where a page sits ​

Workspace breadcrumb trail

Themed breadcrumb trail with collapsed parent segments above a release header.

A release page header leads with a GhostBreadcrumb trail from @ghostvue/themes. Each ancestor is a GhostBreadcrumbLink, an ordinary <a href> that the browser or your router follows, so readers can Tab to a parent and press Enter to go there. The current release is a GhostBreadcrumbPage, which sets aria-current="page" and is not a link. aria-label="Project location" names the navigation landmark, so screen reader users can tell it from the site navigation.

Three middle folders sit behind a GhostBreadcrumbEllipsis labelled "Show parent folders". Press Enter or Space on it to open a menu of those links, then Tab through them; Escape closes the menu and returns focus to the ellipsis.

Collapsed middle segments ​

Collapsed segments

Ellipsis popover exposes middle ancestors.

GhostBreadcrumbEllipsis composes GhostPopover so middle segments stay reachable by keyboard and assistive technologies. Put collapsed links in the ellipsis default slot and give the ellipsis a label that says what it hides. Attributes such as class and style land on the ellipsis host element. The popover content is portaled to body; the themed part marks both the trigger and that content with data-themed, so the menu gets the elevated popover surface without a .ghost-theme ancestor.

Place each GhostBreadcrumbSeparator inside the same GhostBreadcrumbItem as the preceding link or ellipsis, so separators never become invalid direct children of the ol.

Custom separators ​

Use the separator slot for non-default glyphs:

vue
<GhostBreadcrumbSeparator aria-hidden="true">/</GhostBreadcrumbSeparator>

Decorative separators are always aria-hidden="true".

Accessibility ​

Follow the breadcrumb specification for landmark naming, current-page semantics, and ellipsis keyboard support.

Advanced: headless composition ​

For teams that bring their own design system, the same parts from @ghostvue/vue render the landmark, ordered list, links, current page and separators with no visual styling.

Basic trail ​

Basic Headless

Headless ordered trail with current page semantics, laid out by consumer CSS on data-part hooks.

Ancestor segments use GhostBreadcrumbLink. The current page uses GhostBreadcrumbPage, which sets aria-current="page". The headless parts add no list reset or inline layout. The example's own CSS lays the trail out on one wrapping line and styles the parts through their data-part hooks (list, item, link, separator, page), with system-color fallbacks so it stays readable without a theme.

API ​

See the specification. Generated manifests live under packages/vue/manifests/ghost-breadcrumb*.manifest.json.

PropTypeDefaultDescription
ariaLabelstring"Breadcrumb"Accessible name for the breadcrumb navigation.
asGhostBreadcrumbElement"nav"Tag name or component rendered for the navigation landmark.
SlotSlot propsDescription
default—Primary content.

@ghostvue/themes adds no props, events, or slots to the headless GhostBreadcrumb API, which it forwards.

PartElementKey semantics
GhostBreadcrumbnavaria-label
GhostBreadcrumbListolordered trail
GhostBreadcrumbItemliwraps segment + separator
GhostBreadcrumbLinkaancestor hyperlink
GhostBreadcrumbPagespanaria-current="page"
GhostBreadcrumbSeparatorspanaria-hidden
GhostBreadcrumbEllipsisbuttonpopover with collapsed ancestors

GhostBreadcrumbLink takes a router link component through as, typed like GhostLink: :as="RouterLink" checks to under strictTemplates.