Skip to content

feat(#3589): add breadcrumb navigation to docs website#3590

Open
twjeffery wants to merge 1 commit intodevfrom
tom/breadcrumbs
Open

feat(#3589): add breadcrumb navigation to docs website#3590
twjeffery wants to merge 1 commit intodevfrom
tom/breadcrumbs

Conversation

@twjeffery
Copy link
Collaborator

@twjeffery twjeffery commented Mar 16, 2026

Summary

  • Adds an auto-generated breadcrumb component that derives the navigation trail from the URL path
  • Shows at least the section name on every page (Components, Get Started, Tokens, etc)
  • Component pages include the category group (e.g. "Inputs and actions") linking back to All Components with that category pre-filtered
  • Replaces category badge on component pages and "Back to all examples" link on example pages
  • Keyboard-only focus styles, visually-hidden current page for screen readers (aria-current)

Closes #3589

Approach

Built as an Astro component first for our docs site as a proof of concept. We can learn from this before designing a shared Svelte breadcrumb component for the UI component library.

File-by-file walkthrough

Breadcrumbs.astro (new, 142 lines)
The core component. Derives the breadcrumb trail from the URL path automatically. Each segment gets a label from a lookup map (or falls back to formatting the slug). Always shows at least the section name. Has an optional parentGroup prop for when the logical hierarchy isn't in the URL (only used by component pages for the category). Current page is visually hidden but available to screen readers via aria-current="page". Uses design tokens for all styling, focus-visible for keyboard-only focus rings.

ComponentsGrid.tsx (+16 lines)
Adds URL param reading on mount so ?category=inputs-and-actions pre-filters the grid. This is what makes the breadcrumb category link work. Same pattern ExamplesGrid already uses.

DocumentationPageLayout.astro (+10 lines)
Adds breadcrumbs inside the content card. breadcrumb-row has a 960px max-width to match the content grid centering.

ExamplesPageLayout.astro (+9 lines)
Same as above but 1408px max-width to match the examples content area.

TokensLayout.astro (+9 lines)
Same as above, 1408px max-width.

components/[slug].astro (+5/-4 lines)
Passes the component's category as parentGroup with a link to /components?category=.... Removes the old category badge that was above the title (breadcrumbs replace that context).

components/index.astro (+2 lines)
Adds breadcrumbs to the All Components page.

examples/[slug].astro (-10 lines)
Removes the "Back to all examples" link and its CSS. Breadcrumbs in the layout handle this navigation now.

image image image

Test plan

  • Navigate to /components/button and verify breadcrumb shows Design System / Components / Inputs and actions /
  • Click "Inputs and actions" in the breadcrumb and confirm it goes to /components with the category filter applied
  • Navigate to /get-started/designers and verify breadcrumb shows Design System / Get Started /
  • Check section landing pages (/components, /tokens, /examples) show the section name
  • Tab through breadcrumb links to verify focus ring only appears on keyboard nav, not on click
  • Test with a screen reader to confirm aria-current="page" is announced

Add Breadcrumbs component that derives navigation trail from URL path.
Integrated into DocumentationPageLayout, TokensLayout, ExamplesPageLayout,
and component page templates (inside each page's centering container to
handle different max-widths). Replaces category badge on component pages
and "Back to all examples" link on example pages.

Component pages show their category in the breadcrumb trail with a link
to the All Components page filtered by that category. ComponentsGrid now
reads ?category= URL params to support this. Keyboard-only focus styles,
visually-hidden current page for screen readers (aria-current="page").
@twjeffery twjeffery changed the title feat(docs): add breadcrumb navigation to docs website feat(#3589): add breadcrumb navigation to docs website Mar 16, 2026
@netlify
Copy link

netlify bot commented Mar 16, 2026

Deploy Preview for goa-design-2 ready!

Name Link
🔨 Latest commit 49cad8c
🔍 Latest deploy log https://app.netlify.com/projects/goa-design-2/deploys/69b85a598d874a00085118e2
😎 Deploy Preview https://deploy-preview-3590--goa-design-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add breadcrumb navigation to docs website

1 participant