Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

UIComponentsReact

Breadcrumb

The path from the top of the site to the current page.

Built on the headless Breadcrumb.See its API in Docs

Rendered by React 19.3.1

breadcrumb.tsx

Installation

npx shadcn@4.23.0 add https://hamur.dev/r/react/breadcrumb.json

It also adds utils. The app needs its setup first: Installation.

Usage

BreadcrumbList holds BreadcrumbItems with a BreadcrumbLink or, for the current page, BreadcrumbPage; put a BreadcrumbSeparator between items and BreadcrumbEllipsis where levels are left out.

import {
  Breadcrumb,
  BreadcrumbList,
  BreadcrumbItem,
  BreadcrumbLink,
  BreadcrumbPage,
  BreadcrumbSeparator,
  BreadcrumbEllipsis,
} from '@/components/ui/breadcrumb'

Examples

Default

Three levels and the current page.

Its preview and code are at the top of the page.

The item is the headless Breadcrumb under shadcn's names, so it differs from shadcn's in these places:

- BreadcrumbPage is a span with aria-current="page" and no role="link" or aria-disabled: a link role on text that is not focusable is skipped by TalkBack and rejected by accessibility linters. - BreadcrumbLink takes active, which sets aria-current="page" and keeps the link's href and focus; render still replaces the <a>. - The nav is named "breadcrumb", as in shadcn, unless it is given aria-label or aria-labelledby. - The headless Breadcrumb.Collection is not part of the item; use it with BreadcrumbList to collapse a long trail.

API reference

The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Breadcrumb's API reference.