Breadcrumbs
Help users orientate themselves and navigate pages within a hierarchical structure.
Children are ItemComposites.
Read the Design System guidance for breadcrumbs
Import
import * as Breadcrumbs from 'govuk-react/breadcrumbs';Examples
Default
Code
<Breadcrumbs.Composite>
{(
<>
<Breadcrumbs.ItemComposite href="#">Home</Breadcrumbs.ItemComposite>
<Breadcrumbs.ItemComposite href="#">Passports, travel and living abroad</Breadcrumbs.ItemComposite>
<Breadcrumbs.ItemComposite>Travel abroad</Breadcrumbs.ItemComposite>
</>
)}
</Breadcrumbs.Composite>Collapse on mobile
Code
<Breadcrumbs.Composite collapseOnMobile>
{(
<>
<Breadcrumbs.ItemComposite href="#">Home</Breadcrumbs.ItemComposite>
<Breadcrumbs.ItemComposite href="#">Passports, travel and living abroad</Breadcrumbs.ItemComposite>
<Breadcrumbs.ItemComposite>Travel abroad</Breadcrumbs.ItemComposite>
</>
)}
</Breadcrumbs.Composite>API reference
Breadcrumbs.Root
Help users orientate themselves and navigate pages within a hierarchical structure.
| Prop | Type |
|---|---|
collapseOnMobileWhen true, the breadcrumbs will collapse to the first and last item only on tablet breakpoint and below. | boolean |
inverseUse on dark backgrounds. | boolean |
Breadcrumbs.Composite
Help users orientate themselves and navigate pages within a hierarchical structure.
Children are ItemComposites.
| Prop | Type |
|---|---|
collapseOnMobileWhen true, the breadcrumbs will collapse to the first and last item only on tablet breakpoint and below. | boolean |
inverseUse on dark backgrounds. | boolean |
itemsPrefer children, which memoise and re-render better. | ItemCompositeProps[] |
Breadcrumbs.Item
No props of its own. Other props are passed to the element it renders.
Breadcrumbs.ItemComposite
A link, or the current page when there's no href.
| Prop | Type |
|---|---|
hrefLink for the breadcrumbs item. If not specified, breadcrumbs item is a normal list item. | string |
Breadcrumbs.Link
| Prop | Type |
|---|---|
asChildRender the only child (such as a router's link) instead of an | boolean |
Breadcrumbs.List
No props of its own. Other props are passed to the element it renders.