Skip to main content

Breadcrumb

Examples

Check out the Usage section for details about how to design a breadcrumb properly, and the different configuration options we provide.

Basic example

Add a secondary navigation component to show a user their current location in respect to parent levels.

<Breadcrumb
links={[
{
href: 'grandparent-url',
text: 'Grandparent Page',
},
{
href: 'parent-url',
text: 'Parent page',
},
{
text: 'Current Page',
},
]}
/>

Last item clickable example

By default the last item is not a clickable link, however you can change this using the lastItemClickable property.

<Breadcrumb
lastItemClickable={true}
links={[
{
href: 'grandparent-url',
text: 'Grandparent Page',
},
{
href: 'parent-url',
text: 'Parent page',
},
{
href: 'current-url',
text: 'Current Page',
},
]}
/>

If there is only one parent, the component renders as a link with the text "Back" and a left-facing arrow. The showTwoBreadcrumbs property takes precedence over this property.

<Breadcrumb
links={[
{
href: 'parent-url',
text: 'Parent page',
},
{
text: 'Current Page',
},
]}
/>

If there is only one parent and the backLinkWithoutText property is true, the component renders as just a left-facing arrow. The showTwoBreadcrumbs property takes precedence over this property.

<Breadcrumb
backLinkWithoutText={true}
links={[
{
href: 'parent-url',
text: 'Parent page',
},
{
text: 'Current Page',
},
]}
/>

Show Two Breadcrumbs example

If there are exactly two breadcrumb items and the showTwoBreadcrumbs is set to true, the component renders both the parent and current page as clickable breadcrumbs. If showTwoBreadcrumbs is false, a back link renders as an arrow, with or without text depending on backLinkWithoutText.

<Breadcrumb
showTwoBreadcrumbs={true}
links={[
{
href: 'parent-url',
text: 'Parent page',
},
{
href: 'current-url',
text: 'Current Page',
},
]}
/>