Building an Accessible Breadcrumb Navigation with Liquid and Shopify

breadcrumb navigation

Breadcrumbs, or a breadcrumb navigation, can help to enhance how users navigate a website, especially if that website has many pages or products.Breadcrumbs can reduce the number of actions a visitor needs to takein order to navigate to a higher-level page, and improve the discoverability of a website’s sections and pages. A breadcrumb navigation shows a user which page they are currently viewing, by displaying a list of links to a user representing a website’s hierarchy in relation to that user’s current position.

breadcrumb navigation: simple theme
Tabbing through this tutorials’ accessible breadcrumbs styled inside Simple theme.

This article will walk you through the process and reasoning behind creating an accessible breadcrumb navigation menu in a Shopify theme.

Basic structure and ARIA

After some research, I founddocumentation on breadcrumbs in the most up-to-date versionof the WIA-ARIA (Web Accessibility Initiative–Accessible Rich Internet Applications) authoring practices. The WIA-ARIA specification outlines a basic example and some requirements when building accessible breadcrumbs. It states:

  • Breadcrumb trail is contained within a navigation landmark region.
  • The landmark region is labeled viaaria-labeloraria-labelledby
  • The link to the current page hasaria-currentset topage.If the element representing the current page is not a link,aria-currentis optional.

There’s agreat little example in this documentation.Additionally,Scott O’Harahas a nice implementation of it inthis GitHub repo

In this simplified example, a

Topics:

Grow your business with the Shopify Partner Program

Learn more