Breadcrumbs

The Breadcrumbs component is a navigational aid that displays the hierarchical path or location of the current page within the website or application. It provides users with a clear visual representation of their navigation history, allowing them to quickly understand where they are within the overall structure and easily navigate back to previous pages.

Introduction

The breadcrumbs component consists of a list of linked items that represent the navigation hierarchy. Each item typically corresponds to a page or section and is displayed in sequential order, starting from the top-level page and ending with the current page. The component's design and layout are highly flexible, allowing it to adapt to various styles and requirements.

Visual representation

The component is visually presented as a horizontal list of clickable items, separated by a designated separator. The separator is usually an "slash" or a custom icon (usually a right facing caret), indicating the hierarchical relationship between the items.

The default version of the UAE Design System recommends the use of a "forward slash" as the seperator which is added by the ` .with-seperator ` and does not require you to add an element in the code structure. By adding this class, the "forward slash" will be added at the end of a link.

 

It is very important to note that the breadcrumb will auto truncate long text and add the seperator as default, giving you the least need to add anything additional.

Code structure

To use the breadcrumbs component, you can utilize the following code structure:

<nav aria-label="Breadcrumb" class="aegov-breadcrumb with-seperator">
	<ol>
		<li><a href="#">Index Link</a></li>
		<li><a href="#" title="Link">Link</a></li>
		<li><a href="#" title="Link">Link</a></li>
		<li><span aria-current="page">Current Page or post</span></li>
	</ol>
</nav>

Variations

Variations are different versions of this component that you may use within your website. The choice of what variation is useful should be based on the user experience study and layout design applied to the page of your website.

Breadcrumbs with a home icon

You may want to add an icon to the first link - usually the link to the homepage. This variation showcases how you can add an icon to the first link.

Custom separator

You may want to use an icon as a seperator within the breadcrumb component. Instead of the default separator, this variation utilizes custom icons between breadcrumb links, adding a unique visual appeal while maintaining clarity in the path to the current page.

The UAE Design System recommends that should you want to not use the default "forward slash" seperator, the next best alternative is the right facing caret. Anything apart from this is not recommended.

Microdata-enabled breadcrumbs with schema.org support

This variation of the breadcrumbs component enhances accessibility and search engine optimization by incorporating Schema.org microdata.

By using the "itemprop" and "itemscope" attributes, each breadcrumb item is associated with structured data, providing semantic meaning to search engines and assistive technologies.


Content management system generated

Content management systems (CMS) have plugins and built in functionality to generate breadcrumbs.

For example, the popular CMS WordPress has a number of plugins to do this. The popular plugin - Yoast SEO, generates the breadcrumbs dynamically based on a number of input parameters that the user may configure within the CMS.

This plugin does not utilize the approach of using a <ul> and <li> to organise the links. Instead, it falls back to the use of <span> for each element including the seperator. Although not a standard, the default action of the plugin is to output the breadcrumb scope as a javascript object too.

The following is an example of how the UAE Design System will manage the UI when the Yoast SEO plugin would output breadcrumbs.

For the purpose of an example only.

The above is only for the purpose of an example. It is not an approved layout to use.

It is here to showcase that CMS auto generated breadcrumbs can still be styled to match the design recommended by the UAE Design System.


Behaviour

A breadcrumb is a navigational aid used in user interfaces. It allows users to understand their current location within a website or application and provides a simple way to navigate back to previous sections.

When user's interact with the breadcrumb links, they should be directed to the corresponding pages or sections. The breadcrumb trail should dynamically adjust based on the user's navigation path, reflecting the most recent pages visited.

Accessibility

There are a number of features that define accessible use of breadcrumbs. It is essential to follow the attributes of accessiblity when adding breadcrumbs to websites.

  • The ` <nav> ` element must container the ` aria-label="Breadcrumb" ` atrribute.
  • Each anchor tag in the breadcrumb must contain the ` title="" ` attribute. Each breadcrumb link should have clear and descriptive text that provides context, even when read out of its surrounding content.
  • Semantic structure requires that the breadcrumb links must be wrapped in a ` <nav> ` element.
  • The current page or section, usually the last item in the breadcrumb trail, should be clearly indicated. It should typically not be a link but rather a plain text item. You must use the ` aria-current="page" ` attribute to signal the current page or step.
  • Visual separators are mandatory to use. However, if you opt to use a custom icon as a seperator, it is mandatory to add the ` aria-hidden="true" ` attribute to the icon element.
  • The text and background colors for breadcrumb links should meet the minimum contrast ratio requirements specified by WCAG (Web Content Accessibility Guidelines) to ensure readability by users with visual impairments.
  • Breadcrumb links should have a clear focus style. The UAE Design System auto adds the focus ring to the link elements.
  • While this is more about usability than accessibility, ensuring that breadcrumbs adjust well on all screen sizes.

RTL support

This component is supported and configured to work for RTL layouts. Refer to the layout guideline to understand how to enabled RTL for websites.

The following is an example of this component with text in Arabic.

All components that are part of the UAE Design System support RTL and have been designed to work for languages that require RTL layout.

The typography guidelines will also provide further information on use of the font stack for the Arabic language.


Usage

We recommend that all pages on a website, apart from the homepage, must include the breadcrumb component. As suggested by best practices of web design layouts, the breadcrumb component must be placed high up on the page - just before or after the title of the page.