When a breadcrumb contains more than eight items, the breadcrumb auto-collapses and uses ellipses to
indicate more information. The first and last items are shown by default. Users expand the
breadcrumb by selecting the ellipsis.
You can customise the maximum number of breadcrumbs using the maxItems prop. When there are more
than the maximum number of nested links, the breadcrumb auto-collapses with an ellipses in between
the items. Select the ellipses to reveal the hidden items.
When expanded, breadcrumbs that exceed the page width will overflow to the next line.
import React from 'react';
import Breadcrumbs, { BreadcrumbsItem } from '@atlaskit/breadcrumbs';
import { BreadcrumbsCurrentItem } from '@atlaskit/breadcrumbs/breadcrumbs-current-item';
const BreadcrumbsExpandedExample = (): React.JSX.Element => {
return (
<div
style={{
maxWidth: '500px',
}}
>
<Breadcrumbs maxItems={5}>
<BreadcrumbsItem href="/item" text="Item" />
<BreadcrumbsItem href="/item" text="Another item" />
<BreadcrumbsItem href="/item" text="A third item" />
<BreadcrumbsItem href="/item" text="A fourth item with a very long name" />
<BreadcrumbsItem href="/item" text="Item 5" />
<BreadcrumbsCurrentItem href="/item" text="A sixth item" />
</Breadcrumbs>
</div>
);
};
export default BreadcrumbsExpandedExample;
Items before or after collapse
The number of items shown before or after auto-collapse can be customized. This is useful when
people need more information on the breadcrumb hierarchy to be aware of their location within the
app.
To reduce screen clutter, it's recommended to only display the first and last items when collapsing.
When a truncationWidth is specified, long item names will truncate and a
tooltip containing the full item name will appear on hover. If unspecified,
truncation only happens when an item cannot fit alone on a line.
import React from 'react';
import Breadcrumbs, { BreadcrumbsItem } from '@atlaskit/breadcrumbs';
import { BreadcrumbsCurrentItem } from '@atlaskit/breadcrumbs/breadcrumbs-current-item';
const BreadcrumbsItemTruncationExample = (): React.JSX.Element => {
return (
<Breadcrumbs>
<BreadcrumbsItem text="Confluence" />
<BreadcrumbsItem
truncationWidth={100}
text="The new Confluence experience will soon be on for everyone"
/>
<BreadcrumbsCurrentItem href="/current-page" text="Current page" />
</Breadcrumbs>
);
};
export default BreadcrumbsItemTruncationExample;
Was this page helpful?
We use this feedback to improve our documentation.