Skip to content

Breadcrumbs

A hierarchical navigation trail. It shows users where they are and gives them a way back up. It collapses the middle segments when the trail is long.

Navigation · TaishoDS Core, in plain HTML.

Examples

One working example per case. Each example is the HTML of its preview—copy it as is, and with Core’s CSS and JS loaded, it looks and works the same.

Path with collapsed segments

html

When to use

  • The content lives in a multi-level hierarchy, and showing the path helps.
  • Users can land directly from outside and need to get their bearings.
  • Going up a level is a frequent move.

When not to use

  • The site is flat and there’s no hierarchy to show → nav-bar.
  • It’s progress through a reading sequence, not a hierarchy → pager.
  • It’s the table of contents for the current page → toc.

Do

  • Reflect the real hierarchy, not the user’s click history.
  • For long trails, collapse the middle and keep the start and end visible.

Don’t

  • Don’t make the current level clickable. The user is already there.
  • Don’t use them as a substitute for primary navigation.

TaishoDS Core

Needs Core’s JS, which hooks in through data-ts-* attributes.

Long paths collapse behind a …, and Core expands them.

Core hooks into it through these attributes. They go in the markup, and there’s nothing to initialize.

  • data-ts-toggle
  • data-ts-toggle-hide
  • data-ts-toggle-target

What it does: Toggles the collapsed segment.

From the CDN, without a build, load taisho.breadcrumbs.css along with taisho.base.css. Also load:

  • taisho.button.css
  • taisho.icon.css
  • taisho.spinner.css

For how Core works in general, see Behavior.

Accessibility

Implements the Breadcrumb pattern from the WAI-ARIA APG.

  • The navigation goes in a <nav> with an aria-label. The current item carries aria-current="page", which you write yourself along with is-active (the class alone only changes the look).
  • The separators are decorative (CSS) and aren’t read by screen readers.

Verification

What was actually tested. Anything that wasn’t tested says so—we’d rather say “not verified” than claim too much.

  • axe WCAG 2.2 A + AA in a real browser, in light and dark mode, before every release.
  • keyboard Adds no keys of its own—it uses the browser’s native behavior.
  • screen reader Not verified with a screen reader. Test it in your own combination of components, not just here, where each one appears alone and on its happy path.