Breadcrumb

A hand-drawn breadcrumb navigation trail showing the path to the current page.

Overview

A Breadcrumb shows where the current page sits in the site hierarchy and lets people jump back up the trail. It is a secondary navigation aid — not a replacement for primary navigation.

Anatomy

A <nav> landmark wrapping an ordered list: each ancestor is a link, separated by a hand-drawn chevron, and the last entry is the current page (not a link). The API is data-driven on every platform — pass an items array of { label, href? }.

Variants & States

State Status Notes
Link Implemented Every item except the last is an activatable link.
Current page Implemented The last item is marked aria-current="page" and is not a link.
Hover Implemented Links shift to the primary text colour on hover (web).
Disabled Not implemented

Usage

Do

  • Order items from the site root to the current page.
  • Keep labels short — match the page titles they link to.
  • Use it for hierarchy, not for step-by-step flows (use a stepper/wizard for those).

Don't

  • Don't make the current page a link — it is the page you are on.
  • Don't use a breadcrumb as the only way to navigate; it complements primary nav.

Accessibility

Content

Short, recognisable labels that mirror the destination page titles. The last item names the current page.

Props API

React@ghds/react

PropTypeDefaultDescription
itemsBreadcrumbItem[]Trail of { label, href? }; last item is the current page.
labelstring'Breadcrumb'Accessible name for the nav landmark.
onSelect(item, index) => voidFires when a link is activated.

Web Components@ghds/web-components

PropTypeDefaultDescription
itemsGhBreadcrumbItem[]Property (not attribute) — set via JS.
labelstring'Breadcrumb'Accessible name for the nav landmark.
select eventCustomEvent<{ item, index }>Dispatched on link activation.

React Native@ghds/react-native

PropTypeDefaultDescription
itemsBreadcrumbItem[]Trail of { label, href? }.
labelstring'Breadcrumb'Accessible name.
onSelect(item, index) => voidNavigate here — there is no href on RN.
testIDstringTest handle for queries.

Code examples

// React — @ghds/react
import { Breadcrumb } from '@ghds/react/breadcrumb';

<Breadcrumb
  items={[
    { label: 'Home', href: '#' },
    { label: 'Components', href: '#' },
    { label: 'Breadcrumb' },
  ]}
/>;
<!-- Web Components — @ghds/web-components -->
<script type="module">
  import '@ghds/web-components/breadcrumb';
  const el = document.getElementById('crumbs');
  el.items = [
    { label: 'Home', href: '#' },
    { label: 'Components', href: '#' },
    { label: 'Breadcrumb' },
  ];
  el.addEventListener('select', (e) => console.log(e.detail.item, e.detail.index));
</script>
<gh-breadcrumb id="crumbs"></gh-breadcrumb>
// React Native — @ghds/react-native
import { Breadcrumb } from '@ghds/react-native/breadcrumb';

<Breadcrumb
  items={[{ label: 'Home', href: '/' }, { label: 'Data' }]}
  onSelect={(item) => navigate(item.href)}
/>;

Live Demo

React @ghds/react

Web Components @ghds/web-components