# Breadcrumbs

Navigate a hierarchy with a compact overflow menu.

Access: free. Category: Navigation. Kind: composite.

## When to use

- Use it when a page needs navigate a hierarchy with a compact overflow menu.
- Choose it as the nav region when composing a page from independently reusable TidalUI sections.

## Alternatives

- Choose navigation-bar instead when responsive saas navigation with native links, actions and an in-flow mobile disclosure is the actual interface need, rather than breadcrumbs.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Breadcrumbs

```sh
npx shadcn@latest add https://tidalui.com/r/breadcrumb.json
```

Stylesheets: `components/ui/tidal.css`, `components/ui/breadcrumb.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/breadcrumb.css";
import{TidalBreadcrumb}from"./components/ui/breadcrumb";
export default()=><div className="tidal-scope"><TidalBreadcrumb items={[{id:"example",label:"Demo"}]}/></div>;
```

## Structured props

- `TidalBreadcrumb.items: Array<TidalBreadcrumbItem>`: Required items value accepted by this exported component.
- `TidalBreadcrumb.label?: string | undefined` (default "Breadcrumb"): Optional label value accepted by this exported component.
- `TidalBreadcrumb.maxVisible?: number | undefined` (default 4): Optional max visible value accepted by this exported component.
- `TidalBreadcrumb.theme?: "light" | "dark" | undefined` (default "light"): Optional theme value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/breadcrumb.tsx) | [Manifest](https://tidalui.com/examples/breadcrumb.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
import "./components/ui/tidal.css";

import { useRef, useState, type CSSProperties } from "react";

import { ArrowLeft, ArrowUpRight, FileText, Folder, FolderOpen, Grid2X2, Layers, MoreHorizontal } from "lucide-react";

import { TidalBreadcrumb } from "./components/ui/breadcrumb";

import { TidalButton } from "./components/ui/tidal-button";

import "./components/ui/breadcrumb.css";



const tidalExampleStyles = ".breadcrumb-specimen {\n  width: 100%;\n  max-width: 670px;\n  padding: 28px;\n  border: 1px solid var(--t-border);\n  border-radius: var(--t-radius-card);\n  background: var(--t-surface);\n  box-shadow:\n    0 24px 40px -28px #00000035,\n    0 2px 4px #00000008;\n}\n.breadcrumb-specimen > h3 {\n  font-size: 29px;\n  line-height: 1.08;\n  letter-spacing: -1px;\n  font-weight: 500;\n  margin: 13px 0 26px;\n}\n.breadcrumb-specimen > h3 > em {\n  font-family: \"Instrument Serif\", serif;\n  font-size: 1.2em;\n  font-weight: 400;\n}\n.breadcrumb-demo-window {\n  border: 1px solid var(--t-border);\n  border-radius: 13px;\n  background: var(--t-subtle);\n  overflow: hidden;\n}\n.breadcrumb-demo-window-top {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 14px 18px;\n  border-bottom: 1px solid var(--t-border);\n  color: var(--t-muted);\n  font-size: 11px;\n  letter-spacing: 1px;\n}\n.breadcrumb-demo-window-top > span {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n}\n.breadcrumb-demo-path {\n  padding: 8px 12px;\n  background: var(--t-surface);\n  border-bottom: 1px solid var(--t-border);\n}\n.breadcrumb-demo-view {\n  padding: 25px 22px 22px;\n  min-height: 245px;\n  animation: breadcrumb-view-in 420ms var(--t-ease-out) both;\n}\n.breadcrumb-demo-heading {\n  display: flex;\n  align-items: center;\n  gap: 15px;\n  margin-bottom: 21px;\n}\n.breadcrumb-demo-folder-icon {\n  display: grid;\n  place-items: center;\n  width: 54px;\n  height: 58px;\n  border: 1px solid var(--t-border);\n  border-radius: 11px;\n  background: linear-gradient(150deg, var(--t-surface), var(--t-wash));\n  box-shadow:\n    0 3px 5px #00000008,\n    inset 0 1px 0 #ffffff16;\n  transform: rotate(-5deg);\n  animation: breadcrumb-folder-in 620ms var(--t-ease-spring) both;\n}\n.breadcrumb-demo-caption {\n  font-size: 11px;\n  color: var(--t-muted);\n  letter-spacing: 1px;\n}\n.breadcrumb-demo-heading h4 {\n  font-size: 23px;\n  line-height: 1.3;\n  font-weight: 500;\n  letter-spacing: -0.65px;\n  margin: 3px 0 2px;\n  outline-offset: 3px;\n}\n.breadcrumb-demo-heading p {\n  font-size: 11px;\n  color: var(--t-muted);\n  margin: 0;\n}\n.breadcrumb-demo-rows {\n  display: grid;\n  gap: 7px;\n}\n.breadcrumb-demo-rows > button {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  min-height: 64px;\n  width: 100%;\n  padding: 11px 14px;\n  border: 1px solid var(--t-border);\n  border-radius: 10px;\n  background: var(--t-surface);\n  color: var(--t-ink);\n  text-align: left;\n  transition:\n    transform 180ms var(--t-ease-out),\n    border-color 180ms,\n    box-shadow 180ms;\n  animation: breadcrumb-row-in 420ms var(--t-ease-out) var(--folder-delay) both;\n}\n.breadcrumb-demo-rows > button:hover {\n  transform: translateX(3px);\n  border-color: var(--t-muted);\n  box-shadow: 0 3px 9px #00000008;\n}\n.breadcrumb-demo-rows > button:active {\n  transform: translateX(1px) scale(0.99);\n}\n.breadcrumb-demo-row-icon {\n  display: grid;\n  place-items: center;\n  width: 34px;\n  height: 36px;\n  border-radius: 7px;\n  background: var(--t-wash);\n}\n.breadcrumb-demo-rows > button > span:nth-child(2) {\n  flex: 1;\n  min-width: 0;\n}\n.breadcrumb-demo-rows strong {\n  display: block;\n  font-size: 12px;\n  font-weight: 500;\n}\n.breadcrumb-demo-rows small {\n  display: block;\n  font-size: 11px;\n  color: var(--t-muted);\n  margin-top: 2px;\n}\n.breadcrumb-demo-rows > button > svg {\n  color: var(--t-muted);\n  transition: transform 240ms var(--t-ease-out);\n}\n.breadcrumb-demo-rows > button:hover > svg {\n  transform: translate(2px, -2px);\n}\n.breadcrumb-demo-location {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 12px;\n  padding: 13px 19px;\n  border-top: 1px solid var(--t-border);\n  font-size: 11px;\n  color: var(--t-muted);\n  background: var(--t-surface);\n}\n.breadcrumb-demo-location > span:first-child {\n  display: flex;\n  align-items: center;\n  gap: 4px;\n}\n.breadcrumb-demo-location i {\n  width: 10px;\n  height: 3px;\n  background: var(--t-border);\n  border-radius: 1px;\n  animation: breadcrumb-row-in 320ms var(--t-ease-out) both;\n}\n.breadcrumb-demo-location i[data-current=\"true\"] {\n  width: 22px;\n  background: var(--t-ink);\n}\n.breadcrumb-demo-document {\n  border: 1px solid var(--t-border);\n  border-radius: 10px;\n  padding: 10px 16px;\n  background: var(--t-surface);\n}\n.breadcrumb-demo-document p {\n  color: var(--t-ink);\n  display: flex;\n  align-items: baseline;\n  gap: 12px;\n  font-size: 11px;\n  line-height: 1.8;\n  margin: 9px 0;\n  animation: breadcrumb-row-in 420ms var(--t-ease-out) var(--folder-delay) both;\n}\n.breadcrumb-demo-document p > span {\n  font-size: 11px;\n  color: var(--t-muted);\n}\n.breadcrumb-demo-empty {\n  font-size: 12px;\n  color: var(--t-muted);\n  padding: 23px 0;\n  margin: 0;\n}\n.breadcrumb-demo-actions {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 8px;\n  margin-top: 19px;\n}\n.breadcrumb-demo-actions .tidal-button {\n  font-size: 11px;\n  padding: 0 13px;\n}\n.breadcrumb-demo-note {\n  font-size: 11px;\n  color: var(--t-muted);\n  margin: 15px 0 0;\n  line-height: 1.7;\n}\n@keyframes breadcrumb-view-in {\n  from {\n    opacity: 0;\n    transform: translateX(8px);\n  }\n  to {\n    opacity: 1;\n    transform: none;\n  }\n}\n.breadcrumb-specimen[data-direction=\"back\"] .breadcrumb-demo-view {\n  animation-name: breadcrumb-view-back;\n}\n@keyframes breadcrumb-view-back {\n  from {\n    opacity: 0;\n    transform: translateX(-8px);\n  }\n  to {\n    opacity: 1;\n    transform: none;\n  }\n}\n@keyframes breadcrumb-folder-in {\n  from {\n    opacity: 0;\n    transform: translateY(6px) rotate(-11deg) scale(0.9);\n  }\n  to {\n    opacity: 1;\n    transform: rotate(-5deg);\n  }\n}\n@keyframes breadcrumb-row-in {\n  from {\n    opacity: 0;\n    transform: translateY(6px);\n  }\n  to {\n    opacity: 1;\n    transform: none;\n  }\n}\n@media (max-width: 480px) {\n  .breadcrumb-specimen {\n    padding: 20px;\n  }\n  .breadcrumb-demo-view {\n    padding: 20px 15px;\n  }\n  .breadcrumb-demo-path {\n    padding: 6px 8px;\n  }\n  .breadcrumb-demo-heading h4 {\n    font-size: 21px;\n  }\n  .breadcrumb-demo-folder-icon {\n    width: 44px;\n    height: 48px;\n  }\n  .breadcrumb-demo-document {\n    padding: 8px 12px;\n  }\n}\n@media (prefers-reduced-motion: reduce) {\n  .breadcrumb-demo-folder-icon,\n  .breadcrumb-demo-rows > button:hover,\n  .breadcrumb-demo-rows > button:active,\n  .breadcrumb-demo-rows > button:hover > svg {\n    transform: none;\n  }\n}";

type SampleFolder = {
  id: string;
  name: string;
  note: string;
  children?: SampleFolder[];
  lines?: string[];
};

const library: SampleFolder = {
  id: "library",
  name: "Library",
  note: "Your sample workspace",
  children: [
    {
      id: "northstar",
      name: "Northstar",
      note: "A fictional product workspace",
      children: [
        {
          id: "product",
          name: "Product",
          note: "Ideas, brought into focus",
          children: [
            {
              id: "launch",
              name: "Launch",
              note: "The next chapter",
              children: [
                {
                  id: "interface",
                  name: "Interface",
                  note: "Details make the difference",
                  children: [
                    {
                      id: "navigation",
                      name: "Navigation notes",
                      note: "A place for every page",
                      lines: [
                        "Keep a clear path from the workspace to the current page.",
                        "Let people return to an ancestor without losing their place.",
                        "Make the smallest screen as considered as the largest.",
                      ],
                    },
                    {
                      id: "motion",
                      name: "Motion studies",
                      note: "Small changes, carefully connected",
                      lines: [
                        "Let the path move with the content.",
                        "Keep stable elements continuous between views.",
                        "Show every final state immediately with reduced motion.",
                      ],
                    },
                  ],
                },
                {
                  id: "brief",
                  name: "Launch brief",
                  note: "An original sample document",
                  lines: [
                    "A thoughtful first impression.",
                    "A clear way to explore.",
                    "An interface that feels like one connected product.",
                  ],
                },
              ],
            },
            {
              id: "research",
              name: "Research",
              note: "A little room for new ideas",
              children: [],
            },
          ],
        },
        {
          id: "brand",
          name: "Brand",
          note: "One shared visual language",
          children: [],
        },
      ],
    },
    {
      id: "archive",
      name: "Archive",
      note: "A quiet place for past work",
      children: [],
    },
  ],
};

const initial = [
  library,
  library.children![0],
  library.children![0].children![0],
  library.children![0].children![0].children![0],
  library.children![0].children![0].children![0].children![0],
];

export function BreadcrumbDemo({
  theme = "light",
}: {
  theme?: "light" | "dark";
}) {
  const [path, setPath] = useState(initial);
  const [direction, setDirection] = useState("forward");
  const title = useRef<HTMLHeadingElement>(null);
  const current = path[path.length - 1];
  function go(next: SampleFolder[], focusHeading = false) {
    setDirection(next.length < path.length ? "back" : "forward");
    setPath(next);
    if (focusHeading)
      requestAnimationFrame(() =>
        title.current?.focus({ preventScroll: true }),
      );
  }
  return (
    <div className="breadcrumb-specimen" data-direction={direction}>

      <div className="breadcrumb-demo-window">
        <div className="breadcrumb-demo-window-top">
          <span>
            <Layers size={13} aria-hidden="true" /> NORTHSTAR / FILES
          </span>
          <MoreHorizontal size={17} aria-hidden="true" />
        </div>
        <div className="breadcrumb-demo-path">
          <TidalBreadcrumb
            theme={theme}
            label="Sample folder path"
            items={path.map((folder, index) => ({
              id: folder.id,
              label: folder.name,
              icon: index === 0 ? Grid2X2 : undefined,
              onNavigate: () => go(path.slice(0, index + 1), true),
            }))}
          />
        </div>
        <div className="breadcrumb-demo-view" key={current.id}>
          <div className="breadcrumb-demo-heading">
            <span className="breadcrumb-demo-folder-icon" aria-hidden="true">
              {current.lines ? (
                <FileText size={25} />
              ) : (
                <FolderOpen size={27} />
              )}
            </span>
            <div>
              <span className="breadcrumb-demo-caption">
                {current.lines ? "SAMPLE DOCUMENT" : "SAMPLE FOLDER"} ·{" "}
                {String(path.length).padStart(2, "0")}
              </span>
              <h4 ref={title} tabIndex={-1}>
                {current.name}
              </h4>
              <p>{current.note}</p>
            </div>
          </div>
          {current.children?.length ? (
            <div className="breadcrumb-demo-rows">
              {current.children.map((folder, index) => (
                <button
                  key={folder.id}
                  type="button"
                  onClick={() => go([...path, folder], true)}
                  style={
                    {
                      "--folder-delay": `${90 + index * 55}ms`,
                    } as CSSProperties
                  }
                >
                  <span className="breadcrumb-demo-row-icon" aria-hidden="true">
                    {folder.lines ? (
                      <FileText size={18} />
                    ) : (
                      <Folder size={19} />
                    )}
                  </span>
                  <span>
                    <strong>{folder.name}</strong>
                    <small>
                      {folder.lines
                        ? "Original sample document"
                        : `${folder.children?.length || 0} items`}
                    </small>
                  </span>
                  <ArrowUpRight size={16} aria-hidden="true" />
                </button>
              ))}
            </div>
          ) : current.lines ? (
            <article className="breadcrumb-demo-document">
              {current.lines.map((line, index) => (
                <p
                  key={line}
                  style={
                    {
                      "--folder-delay": `${90 + index * 55}ms`,
                    } as CSSProperties
                  }
                >
                  <span aria-hidden="true">0{index + 1}</span>
                  {line}
                </p>
              ))}
            </article>
          ) : (
            <p className="breadcrumb-demo-empty">
              Nothing here yet. The path back is always in reach.
            </p>
          )}
        </div>
        <div className="breadcrumb-demo-location">
          <span aria-hidden="true">
            {path.map((folder, index) => (
              <i key={folder.id} data-current={index === path.length - 1} />
            ))}
          </span>
          <span>
            {path.length} {path.length === 1 ? "level" : "levels"} deep ·{" "}
            {current.children?.length || (current.lines ? 1 : 0)}{" "}
            {current.lines ? "document" : "items"}
          </span>
        </div>
      </div>
      <div className="breadcrumb-demo-actions">
        <TidalButton
          variant="secondary"
          disabled={path.length === 1}
          onClick={() => go(path.slice(0, -1), true)}
        >
          <ArrowLeft size={15} aria-hidden="true" /> Up one level
        </TidalButton>
        <TidalButton
          variant="ghost"
          disabled={current.id === initial[initial.length - 1].id}
          onClick={() => go(initial, true)}
        >
          Reset explorer
        </TidalButton>
      </div>
      <p className="breadcrumb-demo-note">
        Open a folder. Follow the path back. All content is fictional.
      </p>
    </div>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <BreadcrumbDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"The implementation includes reduced-motion behavior; verify it with the consumer's final content."}

Required items: unique nonempty id, label, optional href, onNavigate():void, Lucide icon, disabled. Final item is always the noninteractive current page with aria-current=page. Ancestors use native anchors, buttons or text; href plus onNavigate intercepts only an unmodified primary click, preserving modified-click browser behavior. Optional label(defaultBreadcrumb), maxVisible(default4; finite values floor/clamp to at least2 visible crumbs excluding the overflow button), theme(light|dark, pass for portal), native nav attributes/ref/className/style. Narrow widths automatically collapse middle ancestors while retaining root/current; labels truncate visually with full accessible names, and very long paths wrap. Hidden ancestors use a Radix menu with arrows/Home/End/typeahead/Enter/Escape, disabled skipping and focus return. Stable keyed crumbs interpolate positions and new crumbs reveal; reduced motion shows final states immediately. Empty items render nothing. Consumer owns routing and page focus after navigation.
