Skip to Content

Breadcrumbs

Breadcrumb components are UI elements that display a navigational trail, helping users understand and traverse the hierarchy or path within a website or application.

Expand code
<Breadcrumbs> <a href={'/docs'}>Documentation</a> <a href={'/docs/components'}>Components</a> <span>Breadcrumbs</span> </Breadcrumbs>

HighlightLast

Use the highlightLast prop to add additional styling for the last entry.

Expand code
<Breadcrumbs highlightLast> <a href={'/docs'}>Documentation</a> <a href={'/docs/components'}>Components</a> <span>Breadcrumbs</span> </Breadcrumbs>

Separator

The separator between the breadcrumb elements can be freely customized.

Expand code
<Breadcrumbs separator={'-'}> <a href={'/docs'}>Documentation</a> <a href={'/docs/components'}>Components</a> <span>Breadcrumbs</span> </Breadcrumbs> <Breadcrumbs separator={icon}> <a href={'/docs'}>Documentation</a> <a href={'/docs/components'}>Components</a> <span>Breadcrumbs</span> </Breadcrumbs>

Collapsed breadcrumbs

The maxEntries prop determines how many elements can be visible before they are collapsed.
By default, the limit is set to five.

Expand code
<Breadcrumbs> <span>Documentation</span> <span>Foo</span> <span>Bar</span> <span>Lorem</span> <span>Ipsum</span> <span>Components</span> <span>Breadcrumbs</span> </Breadcrumbs>

Collapsed customization

By default, if the breadcrumbs component is in collapsed state, the first element and the last two elements will still be visible. Use the beforeCollapse & afterCollapse props to change the default behaviour.

Expand code
<Breadcrumbs beforeCollapse={3} afterCollapse={1}> <span>Documentation</span> <span>Foo</span> <span>Bar</span> <span>Lorem</span> <span>Ipsum</span> <span>Components</span> <span>Breadcrumbs</span> </Breadcrumbs>

Props

NameTypeDefaultDescription
afterCollapsenumber2Number of elements after the collapse
aria-labelstring-Adds the aria-label attribute for the <nav/> element wrapping the breadcrumbs
beforeCollapsenumber1Number of elements before the collapse
childrennode-Content of the component
darkbooleanfalseUse the darkmode style
expandButtonLabelstringexpandSets the aria-label attribute of the collapse button
highlightLastbooleanfalseHighlights the last element of the breadcrumbs
maxEntriesnumber5Number of total elements before collapsing takes effect
separatornode”/“Customizes the separator
Last updated on