GitHub

Breadcrumbs

Presentational breadcrumb trail showing the path to the current page. The last item is treated as the current page and is not a link.

Stable .astro import EsaBreadcrumbs from '@esa/ecology/esa-breadcrumbs.astro';

Preview

<EsaBreadcrumbs items={[
  { label: 'Home', href: '/' },
  { label: 'Projects', href: '/projects' },
  { label: 'Wetland Survey' },
]} />

States

Crumbs accept an optional leading icon (raw inline SVG) on any item — useful for a home glyph.

<EsaBreadcrumbs items={[
  { label: 'Home', href: '/', icon: homeIconSvg },
  { label: 'Compliance', href: '/compliance' },
  { label: 'Permits', href: '/compliance/permits' },
  { label: 'NPDES-2024-118' },
]} />

Sizes

<EsaBreadcrumbs items={items} size="xs" />
<EsaBreadcrumbs items={items} size="sm" />
<EsaBreadcrumbs items={items} size="md" />
<EsaBreadcrumbs items={items} size="lg" />

API

PropTypeDefaultDescription
items EsaBreadcrumbItem[] Trail of crumbs. Each item is { label; href?; icon? }. The last item is rendered as the current page.
size 'xs' | 'sm' | 'md' | 'lg' 'md' Type scale of the trail.

Each EsaBreadcrumbItem is { label: string; href?: string; icon?: string }. Omit href on the final item; icon is a raw inline SVG string.

Accessibility

  • Wraps the trail in <nav aria-label="Breadcrumb"> with an ordered <ol>.
  • The last crumb receives aria-current="page" and renders as plain text, not a link.
  • The chevron separator is decorative — marked aria-hidden="true".

Theming surface

Every public token this component reads, extracted from its source at build time. The Resolves to column walks each token's real lineage — component → semantic → primitive → raw value — so you can see exactly where re-pointing it lands. A spoke re-skins by overriding these in its theme-<slug>.css; component internals are never edited. No hook for what you need? File it with /request-lego.

TokenTierResolves to
--breadcrumbs-link-color component #646464 via --color-text-secondary--color-gray-11
--breadcrumbs-link-hover component #202020 via --color-text-primary--color-gray-12
--breadcrumbs-separator-color component #bbbbbb via --color-gray-8
--color-text-primary semantic #202020 via --color-gray-12
--type-size-100 semantic clamp(0.625rem, 0.56rem + 0.32vw, 0.75rem)
--type-size-150 semantic clamp(0.6875rem, 0.61rem + 0.38vw, 0.875rem)
--type-size-200 semantic clamp(0.75rem, 0.66rem + 0.44vw, 0.9375rem)
--type-size-300 semantic clamp(0.875rem, 0.77rem + 0.52vw, 1.125rem)
--font-weight-medium primitive 500
--spacing-100 primitive 0.25rem
--spacing-200 primitive 0.5rem