Breadcrumb
Breadcrumbs provide secondary navigation to help users understand where they are in a website.
Usage
A breadcrumb shows the location of the current page in the site structure. It’s like a path from the current page back to the home page, showing each level of organization in-between. Breadcrumbs allow a user to navigate “up” to a parent section instead of “Back” to the previous page. Use breadcrumbs to help users navigate and understand the organization of your site.
Examples
Default
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxWrapping
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxComponent API
Breadcrumbs are made up of the following elements:
Root
-
<nav>
Use a
<nav>
as the root element. This allows assistive technology to present the breadcrumbs in context as a navigational element on the page. -
aria-label
Default:
'Breadcrumb'
Provide a label that describes the type of navigation provided in the nav element.
List
-
<ol>
Use an
<ol>
for breadcrumb lists. This allows assistive technology to enumerate the items in the breadcrumbs and allows shortcuts between list items.
List Item
-
<li>
Use an
<li>
for breadcrumb list items. This allows assistive technology to enumerate the items in the breadcrumbs and allows shortcuts between list items.
Link
-
<a>
or<span>
Use an
<a>
element when breadcrumb items are clickable. Every item, except for the current page (in our case the last item), represented in the breadcrumb should use an<a>
element.Use a
<span>
for the item in a breadcrumb represents the current page. This element is not clickable. Combine this element with the attributes below to create an accessible “current page” breadcrumb item. -
role="link"
Allows screen readers to communicate the breadcrumb item as if it were a link.
Only userole="link"
on the element describing the current page. -
aria-current="page"
Allows screen readers to communicate that the element represents a link to the current page.
Only use thearia-current
attribute on the element describing the current page. -
aria-disabled="true"
Allows screen readers to communicate that the element is not clickable.
Only usearia-disabled="true"
on element describing the current page.
Seperator
-
aria-hidden="true"
Hide separators from screen readers by using
aria-hidden="true"
. Separators between breadcrumb items should not be read by screen readers.
Accessibility
- Like text, separators must have at least have a contrast ratio of 4.5:1 (WCAG AA) against their background.