Skip to content

Breadcrumbs

A wrapping breadcrumb trail of navigation links with chevron separators and automatic current-page semantics.

Import

import { Breadcrumbs } from "@hyzer-labs/ui"

Demo

const items: BreadcrumbItem[] = [
	{ label: 'Home', href: '/docs' },
	{ label: 'Components', href: '/docs/components/button' },
	{ label: 'Button' } // current page, no href, renders as text
];

<Breadcrumbs {items} />

Props

NameTypeDefaultNote
itemsBreadcrumbItem[]Required. See BreadcrumbItem below.
ariaLabelstring'Breadcrumb'
separatorSnippetReplaces the chevron between items; rendered aria-hidden.
classstringMerged after the hz-breadcrumbs class.

BreadcrumbItem

NameTypeDefaultNote
labelstringRequired.
hrefstringOmit on the last item to render the current page as plain text.
externalbooleanAdds the external-link treatment.
ariaCurrent'page' | 'step' | 'true'The last item gets aria-current="page" automatically; set this to override.

Theme hooks

What this component promises your CSS. The reference theme styles exactly these — from @layer hz-theme, so your unlayered rules win. See Styling Components for the how.

Root class: .hz-breadcrumbs

Data attributes

HookValuesStyles
[aria-current]'page'Not a data hook — Breadcrumbs stamps no data-*. The last crumb carries aria-current, and that is the only state selector on offer.

Part classes

HookValuesStyles
.hz-breadcrumbs-currentchild elementThe final crumb when it has no href (plain text rather than a link).
.hz-breadcrumbs-separatorchild elementThe aria-hidden separator wrapper; sizes its icon to 1em.

Accessibility

Breadcrumbs renders a <nav aria-label="Breadcrumb"> landmark wrapping an ordered list. The last item is the current page: it gets aria-current="page" automatically, and renders as plain text when it has no href. Separators are decorative and aria-hidden.

References: APG Breadcrumb pattern