← Back to Navigation

Navigation pattern

Breadcrumb trail

A compact hierarchy trail with an announced label and a clear current page.

Live example

See the pattern in isolation

The preview uses the same locked-down composition policy as the Agate IDE.

PreviewSandboxed

Canonical source

Copy it, change it, keep it plain

These exact files power the preview and the IDE handoff.

Source

HTML

<main class="example-page" id="home">
  <nav class="breadcrumbs" id="resources" aria-label="Breadcrumb">
    <ol>
      <li><a href="#home">Home</a></li>
      <li><a href="#resources">Resources</a></li>
      <li><span aria-current="page">Navigation</span></li>
    </ol>
  </nav>

  <article>
    <p class="section-label">Navigation pattern</p>
    <h1>A trail back through the structure.</h1>
    <p>Breadcrumbs help people understand where a page sits and return to broader sections.</p>
  </article>
</main>
Source

CSS

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: clamp(1rem, 6vw, 4rem);
  background: #f2e3de;
  color: #2b151d;
  font-family: system-ui, sans-serif;
}

.example-page {
  width: min(100%, 48rem);
  margin-inline: auto;
}

.breadcrumbs {
  margin-bottom: 3rem;
  border-bottom: 2px solid #2b151d;
}

.breadcrumbs ol {
  display: flex;
  margin: 0;
  padding: 0 0 1rem;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.breadcrumbs li + li::before {
  color: #b0436a;
  content: "/";
  font-weight: 900;
}

.breadcrumbs a {
  color: #8e2f50;
  font-weight: 800;
  text-underline-offset: 0.18em;
}

.breadcrumbs a:hover {
  color: #4a2c35;
}

.breadcrumbs a:focus-visible {
  outline: 4px solid #2b151d;
  outline-offset: 3px;
}

.breadcrumbs [aria-current="page"] {
  color: #4a2c35;
  font-weight: 750;
}

.example-page article {
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 4px solid #2b151d;
  background: #f7efe6;
}

.section-label {
  margin: 0 0 0.75rem;
  color: #8e2f50;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.example-page h1 {
  max-width: 14ch;
  margin: 0 0 1rem;
  font-size: clamp(2rem, 8vw, 4rem);
  line-height: 1;
}

.example-page article > p:last-child {
  max-width: 42rem;
  margin: 0;
  color: #4a2c35;
  line-height: 1.65;
}

How it works

A small pattern with visible decisions

An ordered list communicates that the links form a hierarchy. The navigation label identifies the pattern for assistive technology, and the final item uses aria-current="page".

The separators are decorative CSS, so they are not repeated by a screen reader.

Make it yours

Open both files in the workspace.

Agate will protect different saved work before loading this example.