Skip to content

Breadcrumb with Schema.org Structured Data

SEO-friendly Bootstrap 5 breadcrumb with BreadcrumbList microdata, a collapsible mobile path, a search result preview and a JSON-LD copy panel.

Also known as: breadcrumb schema markup, breadcrumblist structured data, seo breadcrumb navigation, breadcrumb json-ld, breadcrumb rich results

Breadcrumb with Schema.org Structured Data live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A Bootstrap 5 breadcrumb that carries Schema.org BreadcrumbList microdata, so search engines can show the page path instead of a raw URL. It comes with a pill-shaped trail, a collapsible path for small screens, a search result preview and a panel with the equivalent JSON-LD. Use it on product, category, documentation and blog pages.

How it works

The root is section.bsd-root. The trail is a nav labelled "Breadcrumb" holding ol.breadcrumb.bsd-crumbs with itemscope itemtype="https://schema.org/BreadcrumbList". Every level is an li with itemprop="itemListElement" and the ListItem type: the link carries itemprop="item", the text sits in span itemprop="name" and a meta itemprop="position" holds the 1-based position. The current page is a .bsd-current pill with aria-current="page"; its URL is given through link itemprop="item" because it is not a clickable link. The chevron divider is an inline SVG set through Bootstrap's --bs-breadcrumb-divider variable.

Below 576px, levels marked .bsd-mid are hidden and the .bsd-more-item button with three dots appears in their place. Clicking .bsd-more adds is-expanded to the list, sets aria-expanded="true" and moves focus to the first revealed link. The microdata stays in the HTML in both states.

On DOMContentLoaded the script reads the microdata of every .bsd-root with readCrumbs() and builds a JSON-LD object from it. It fills .bsd-code with a highlighted copy and builds the .bsd-serp preview: host, the path of the middle levels joined with "›" and the page title. The .bsd-copy button copies a complete script type="application/ld+json" tag and reports the result in .bsd-status.

Customization

  • --bsd-accent and --bsd-accent-soft in .bsd-root: recolor the links, their hover background and the current page pill.
  • --bs-breadcrumb-divider in .bsd-crumbs: replace the chevron SVG with "/", "›" or your own icon.
  • --bsd-page-bg and --bsd-code-bg in .bsd-root: change the section gradient and the dark code panel.
  • Add or remove .bsd-mid on li elements to decide which levels collapse on phones.
  • href values and meta itemprop="position" contents: replace them with your real URLs and keep the positions consecutive.
  • Delete the row with .bsd-panel elements and the matching part of script.js when you only need the breadcrumb itself.

Use cases

  • Online shops: category and product pages show the path in search results instead of a raw URL
  • Documentation sites: a collapsible trail keeps deep page hierarchies readable on phones
  • Blogs and news sites: BreadcrumbList microdata helps search engines understand the site structure
  • SEO audits: preview the search result snippet and copy the matching JSON-LD tag
  • Developer tutorials: use it to teach how breadcrumb microdata maps to JSON-LD

Accessibility

The nav has aria-label="Breadcrumb" and the last item uses aria-current="page". Icons are aria-hidden. The ellipsis button has the label "Show full path" and an aria-expanded state. The scrollable code block is focusable with its own aria-label, and copy feedback is announced through a role="status" element. Links and buttons get a visible focus-visible outline, and hover transitions are off under prefers-reduced-motion: reduce.

Usage notes

Requires Bootstrap 5 and Bootstrap Icons. Use either microdata or JSON-LD on a page, not both with different data. Test the result with Google's Rich Results Test before going live.

Breadcrumb with Schema.org Structured Data at a glance

Framework
Bootstrap 5
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 5, Bootstrap Icons
Layout
Responsive, works on mobile
Category
Breadcrumbs
License
Free for personal and commercial use

Questions about this template

Can I use the Breadcrumb with Schema.org Structured Data code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 5 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
  • <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
Breadcrumb with Schema.org Structured Data – Bootstrap 5 breadcrumbs component screenshot
Breadcrumb with Schema.org Structured Data · Bootstrap 5 Breadcrumbs

More Breadcrumbs

Arrow Breadcrumbs – Pure CSS breadcrumbs preview

Arrow Breadcrumbs

Chevron-shaped breadcrumb steps cut with CSS clip-path, with an interlocking layout, a color ramp toward the current page and a compact dark variant. No JavaScript.

Breadcrumb with Icons – Bootstrap 5 breadcrumbs preview

Breadcrumb with Icons

Bootstrap 5 breadcrumbs with a home icon, icons per level and custom chevron, slash or dot dividers that collapse middle levels on mobile.