Breadcrumb

A breadcrumb trail is a navigation interface that lists and provides access to the pages that lead to the current page along some meaningful path. Like a map with a “you are here” marker, a breadcrumb provides context. It does not matter how you got to the current page.

To be of value, users must understand the meaning of the path. Breadcrumbs are commonly understood when a set of pages form a hierarchy. For example:

  • When pages are organized in a parent-child relationship, sometimes echoed in the URL path
  • When a page is about an item or topic that is a subcategory of a larger category

In either case, the breadcrumb path begins at the top level then descends the hierarchy to the current page.

An example of an accessible breadcrumb that navigates a topic hierarchy is found on Page Structure Tutorial | Web Accessibility Initiative (WAI). The following example illustrates its structure. (Note that it is not a breadcrumb for this page!)

Structure
HTML
1<nav aria-label="breadcrumb">
2 <ul>
3 <li>
4 <a href="/WAI/">
5 Home
6 </a>
7 </li>
8 <li>
9 <a href="/WAI/design-develop/">
10 Design & Development
11 </a>
12 </li>
13 <li>
14 <a href="/WAI/tutorials/">
15 Tutorials
16 </a>
17 </li>
18 <li>
19 <a href="/WAI/tutorials/page-structure/" aria-current="page">
20 Page Structure
21 </a>
22 </li>
23 </ul>
24</nav>
CSS
1[aria-label="breadcrumb"] {
2 ul {
3 list-style: none;
4 padding: 0;
5 }
6
7 li {
8 display: inline;
9 padding: 0;
10 }
11
12 li + li {
13 margin-left: 0.125em;
14 }
15
16 li + li::before {
17 content: "";
18 display: inline-block;
19 width: 0.5em;
20 height: 0.5em;
21 border-top: 1px solid currentColor;
22 border-right: 1px solid currentColor;
23 transform: rotate(45deg);
24 margin-right: 0.5em;
25 }
26
27 li > a[aria-current] {
28 text-decoration: none;
29 font-weight: bolder;
30 }
31}
Accessibility Techniques

The above example illustrates a number of accessibility techniques. It is not a prescription.

  • The breadcrumb is contained within a navigation landmark using aria-label to set the accessibility name “Breadcrumb.”
  • The set of links is constructed as a list so that screen reader users can understand how the linked pages relate to the topic hierarchy.
  • The anchor tag for the current page has aria-current="page", which informs screen reader users that the list item is for the current page in a series of pages—and that activating the link would simply refresh the page.
  • The visual separators between links are constructed by using CSS to decorate empty ::before elements so they will not be announced by screen readers.

Accessibility criteria

Because there is no specific ARIA role for the breadcrumb pattern, breadcrumb navigation may be particularly difficult to discern for assistive technology users. All users should be able to identify its purpose and understand how to use it from its structure and context.

So that assistive technology users can understand its purpose, a breadcrumb trail should be contained within a navigation landmark.

Navigation role

A breadcrumb should be contained in an HTML nav element or a generic element with the attribute role="navigation". To avoid potential conflicts, avoid setting role on the nav element, where the navigation role is implied.

Navigation not nested

To allow screen reader users to navigate easily to the breadcrumb landmark and to avoid confusion, the breadcrumb navigation landmark should not be contained within a parent navigation landmark. Recommended location is before the main landmark.

Navigation named

So that screen reader users can also perceive its purpose and distinguish it from other navigation landmark, the breadcrumb navigation should have an accessibility label provided with either aria-label or aria-labelledby.

Example:

1<div role="navigation" aria-label="Breadcrumb">
2 <!-- breadcrumb trail -->
3</div>

A breadcrumb trail not only informs of location but also provides access to the pages along its path.

Link role

A breadcrumb provides access to the pages on its trail with elements with link role:

  • An HTML a element with href attribute has implicit role of link.
  • A generic HTML element that explicitly sets role="link" can be used if it also provides all the functionality and accessibility of the a[href] element. Refer to Evinced Knowledge Base — Link for further information.
Links named

Each link in the breadcrumb trail should have an accessibility name for the page to which it links. By default, a name is derived from the text content of the link element or, if the content is an image or icon, the element’s accessibility name, which can be provided with an alt attribute. If the derived text is not appropriate, a name can be provided by setting an aria-label attribute on the link element.

Links enabled

Disabling a link in a breadcrumb trail is not consistent with breadcrumb semantics. Further, the ARIA specification advises that, “while aria-disabled and proper scripting can successfully disable an element with role link,” doing so can be problematic and is not advised.

List Structure

Order matters in a breadcrumb. It presents a meaningful sequence of pages in a list that leads to the current page.

One page per list item

Each breadcrumb list item identifies one and only one page on the breadcrumb trail.

Separators

Separators in the visual presentation of a breadcrumb trail are clues to its purpose and structure those who can see them but are a distraction for those who cannot. Screen reader users are informed by the breadcrumb’s ARIA attributes and its list structure.

Some techniques to add separators for visual presentation without exposing them to screen reader users include the following:

  • Use CSS to display a separator shape in a pseudo element, such as shown in the CSS example in this article. Until recently, there has not been a means to provide alternative text for a pseudo element, so a suitable shape needed to be constructed by applying CSS properties with an empty content property. Alt text for generated CSS content became available in 2024 and is gaining wide support in modern browsers. Check caniuse.com for current support status. Avoid exposing pseudo element separators to screen reader users by providing an empty string for the alt text as in the following example:

    1li + li::before {
    2 content: "\276E" / "";
    3}
  • Add presentational separators in list items with a page link, using ARIA to avoid exposing the separators to screen reader users, as in the following example:

    1<nav aria-label="breadcrumb">
    2 <ol>
    3 <li>
    4 <a href="/">Evinced Accessibility Knowledge Base</a>
    5 <span role="presentation"></span>
    6 </li>
    7 <li>
    8 <a href="/components">Components</a>
    9 <span role="presentation"></span>
    10 </li>
    11 <li>
    12 <a aria-current="page">Breadcrumb</a>
    13 </li>
    14 </ol>
    15</nav>
Complex hierarchies

In a complex hierarchy, there may be multiple paths to a page. Attempting to capture that complexity in a breadcrumb trail by including multiple page references in one list item is likely to be confusing and counter productive, especially—but not only—for those using assistive technologies. Rather set the breadcrumb trail to the most usable path and provide alternate means of navigating the page structure.

Current page

A breadcrumb trail begins with the first page in a path that leads to the current page. Users will be confused if the current page is not the last entry.

  • It is best to not set an active link for the current page—the last list entry—to prevent an unexpected page reload and change of context.
  • If an active link is used for the current page, the attribute aria-current must be set to a valid value (page or true) on the link so that screen reader users are informed that the link is for the current page.
  • Whether or not a link is used for the current page, setting aria-current will help screen reader users may not be aware that the current list item is the last without navigating forward.

Summary of tests

The following table lists the issues reported by Evinced component testing for a Combobox component.

TestWCAG Success CriteriaSeverity
Element has incorrect role4.1.2 Name, Role, Value (A)Serious
Missing navigation semantics1.3.1 Info and Relationships (A)Serious
Navigation name1.3.1 Info and Relationships (A)Moderate
Nested navigation elementsBest practiceModerate
No group members with required role1.3.1 Info and Relationships (A)Serious
Link has no accessible name4.1.2 Name, Role, Value (A)Critical
Breadcrumb list item with no link1.3.2 Meaningful Sequence (A)Moderate
Multiple links in breadcrumbBest practiceMinor
Breadcrumb invalid aria-current value1.3.1 Info and Relationships (A)Minor
Aria-current offset1.3.2 Meaningful Sequence (A)Serious
Component does not support disabled state4.1.2 Name, Role, Value (A)Serious
Conflicting disabled values4.1.2 Name, Role, Value (A)Serious