Breadcrumb

@sushindustries/ui

The trail, told twice from one list: a visible nav with correct ARIA, and the schema.org BreadcrumbList rendered from the same array.

5 min read
View as MarkdownEdit on GitHub

Breadcrumb renders a page's location twice from one array: a visible <nav> trail with correct ARIA, and - when given an origin - a schema.org BreadcrumbList as JSON-LD built from the same items. Use it wherever a page sits more than one level deep in the site.

Viewport width
Phone22remthe floor, the narrowest this promises to work at
tanstacktanstack add https://adamjurek.com/r/tanstack/breadcrumb.jsonshadcnpnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/breadcrumb.json

Why it is built this way

The visible trail and the JSON-LD are rendered from the same items array on purpose - it is the only arrangement where the two cannot disagree, and search engines are explicit that structured data must describe what the page actually shows. The last crumb renders as text rather than a link: a link to the page you are already on is the one crumb that does nothing, and a screen reader announces it as if it did something.

What it does not do

It renders the JSON-LD only when origin is passed - without it, Breadcrumb is the visible trail alone. Building the item list from a route or a CMS structure is the caller's job; this component only lays out what it is given.

Install commands are not written here

Anything in packages/ui/registry.ts gets its TanStack and shadcn commands attached automatically, so there is nothing to keep in sync.

Install

tanstack add https://adamjurek.com/r/tanstack/breadcrumb.json
shell
pnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/breadcrumb.json
shell
pnpm add @sushindustries/ui @sushindustries/atoms
shell

What you get

Version0.1.0
Categorydocs · Navigation
Filesbreadcrumb.tsx
DependenciesNone
Also installsiconIconThe glyph set, generated from a Markdown table where every drawing carries its reason. One component, typed names, no icon font.@sushindustries/ui · content
Tagsnavigation, seo, json-ld, no-deps

No runtime dependencies

It brings nothing with it beyond the stylesheet.

UsesIconIconThe glyph set, generated from a Markdown table where every drawing carries its reason. One component, typed names, no icon font.@sushindustries/ui · content