Breadcrumb

The path from the section down to this page.

When to use it

Pages deep in a site, so visitors see where they are and can climb back: a product under a category, a guide page under its section.

When not to

The home page and one-level sites, where the path has one step. It is not a menu: put the site's sections in a nav.

Accessibility

A navigation landmark named for the path; the current page is marked as the current one and is not a link.

See it live

The component library shows this component in the default theme, in every variant: open it in the component library

The breadcrumb example as the component library shows it in the default theme

Where it is used

The starter sites that use it, each at a page that shows it:

Fields

What the component’s dialog asks for. In a Doc, keyed rows start with the key; rows in order follow the order below. Each row is a key and its value, in any order.

Field

Key

Kind

Required

Name of the home link

home

A value from a short list, or a setting

No

Variants

A variant changes how the component looks. Write it in parentheses after the name in the table’s first cell, several separated by commas.

Variant

Write in the first cell

Starts with the home page

breadcrumb (home)

In Google Docs

A component is a table. Its first cell names it; the rows below hold its fields. This is the example table:

breadcrumb

In a page file

In a site kept as a folder or in Git, the same component is a block of the page’s JSON file:

JSON
{
  "name": "breadcrumb",
  "variants": [
    "home"
  ],
  "rows": []
}

Markup and classes

What the component writes takes these classes, for a theme’s CSS: the component’s own name, name__part for its parts and name--variant for each variant (the variant’s plain name is there too).

Class

What it marks

breadcrumb

The component

breadcrumb__item

A part of it

breadcrumb__link

A part of it

breadcrumb__list

A part of it

breadcrumb--home

A variant

The HTML the example above writes, as the component library builds it in the default theme:

html
<nav class="breadcrumb" aria-label="Breadcrumb">
<ol class="breadcrumb__list">
<li class="breadcrumb__item"><a class="breadcrumb__link" href="/components/">Components</a></li>
<li class="breadcrumb__item" aria-current="page">breadcrumb</li>
</ol>
</nav>

Visitor texts

Texts it shows visitors, in the page’s language. Every one is in the visitor texts reference.

Key

Text

site.breadcrumb.label

Breadcrumb

site.breadcrumb.home

Home

Extending it

Its files in SeedPage. A theme or a site changes the markup by giving a file of the same name (the Liquid part), and a new component can extend this one.

  • src/components/breadcrumb.js
  • src/components/breadcrumb/breadcrumb.liquid