registry
@automindzsheets 01–77shadcn 4.x
SHEET 10

Breadcrumbs

ui / layout

Breadcrumb trail built from an array of crumbs, with a middle that collapses into a menu once the route gets deep.

type
ui
files
2
registry deps
button, dropdown-menu, skeleton, @automindz/render-link
npm deps
lucide-react

installs

  • lib/automindz/breadcrumb-trail.ts
  • components/ui/breadcrumbs.tsx
  • Trail is data: { label, href? }, deepest last
  • Deep trails collapse to a menu, not an inline expander
  • Labels truncate; the separator never wraps to its own line

Trail is data: items: Crumb[], deepest last. The final crumb renders as text with aria-current="page"; an ancestor with no href does too. Past maxItems (4) the middle collapses into a menu rather than expanding in place, which would put back the width the collapse just saved. renderLink swaps in next/link. The lib is breadcrumb-trail.ts, not breadcrumbs.ts, because shadcn add rewrites intra-item imports by basename — do not rename it back.

Variations

one state per section

01

Trail from data

Four crumbs from an array of { label, href? }, a home glyph on the root, and the current page as text carrying aria-current="page" — a real <nav aria-label="Breadcrumb"> over an <ol>. Tab through it: every ancestor is a link, the last one never is.

fluid
02

Deep trail, collapsed

Seven levels in four slots: root, menu, parent, current. Open the ellipsis — the hidden levels are real links in an overlay, so the trail's width never changes. An inline expander would put back exactly the width the collapse just saved, which on a narrow screen is the failure it exists to prevent. The ellipsis is the button itself, so there is no control nested inside another.

fluid
03

Long labels, tight column

Held at 20rem. Labels truncate and the chevron never lands on a line of its own — each separator lives inside its own crumb's <li> and the list does not wrap. The root keeps its glyph and drops its label to sr-only, which buys the width back without losing the accessible name.

fluid
04

Ancestor without a route

Workspaces has no href here: it is a segment in the URL, not a page. It renders as plain text rather than a link that would 404, and inside the overflow menu it stays listed but inert, so the depth of the trail is still readable.

fluid
05

Loading

A skeleton at the real row height, aria-hidden so nothing reads three grey bars aloud. The trail lands without moving the heading underneath it.

fluid