{
  "schemaVersion": 1,
  "target": "react",
  "name": "breadcrumb",
  "version": "0.1.0",
  "category": "navigation",
  "title": "Breadcrumb",
  "description": "A breadcrumb trail with thin slash separators, a current page, and a collapsed middle that opens a menu of the hidden steps.",
  "tags": [
    "navigation",
    "breadcrumb",
    "links",
    "menu",
    "base-ui"
  ],
  "requires": {
    "projectTypes": [
      "next",
      "vite-react"
    ],
    "styling": "tailwind-v4"
  },
  "npmDependencies": {
    "@base-ui/react": "^1.9.0"
  },
  "registryDependencies": [
    {
      "name": "dropdown-menu",
      "version": "0.2.1"
    }
  ],
  "docsPath": "/components/breadcrumb",
  "props": [
    {
      "name": "Breadcrumb aria-label",
      "type": "string",
      "default": "\"Breadcrumb\"",
      "description": "Accessible name of the nav landmark. Change it when a page has more than one trail."
    },
    {
      "name": "BreadcrumbList / BreadcrumbItem",
      "type": "ComponentProps<\"ol\"> / ComponentProps<\"li\">",
      "description": "The ordered trail and one step in it. The list wraps onto a second line when space runs out."
    },
    {
      "name": "BreadcrumbLink render",
      "type": "ReactElement",
      "description": "Replaces the <a>, for example render={<Link href=\"/settings\" />} for client-side routing. Accepts any anchor attribute."
    },
    {
      "name": "BreadcrumbPage",
      "type": "ComponentProps<\"span\">",
      "description": "The current page, with aria-current=\"page\". Long titles truncate."
    },
    {
      "name": "BreadcrumbSeparator children",
      "type": "ReactNode",
      "description": "Replaces the default slash mark between steps."
    },
    {
      "name": "BreadcrumbOverflow items",
      "type": "{ label, href, render? }[]",
      "description": "Steps hidden behind the ellipsis button, in trail order. Each opens as a link in a menu."
    },
    {
      "name": "BreadcrumbOverflow aria-label",
      "type": "string",
      "default": "\"Show N more pages\"",
      "description": "Accessible name of the ellipsis button."
    }
  ],
  "accessibility": [
    "Renders a nav landmark named \"Breadcrumb\" holding an ordered list, so screen readers announce the number of steps and their order.",
    "The current page is plain text with aria-current=\"page\", not a link to itself.",
    "Separators are hidden from assistive technology with aria-hidden and role=\"presentation\"; the list order carries the meaning.",
    "The ellipsis is a real button with an accessible name such as \"Show 3 more pages\"; Enter, Space, or ArrowDown opens the menu of hidden steps, and the arrow keys move between them.",
    "Hidden steps are rendered as links inside the menu (role=\"menuitem\" on an <a>), so they can be opened in a new tab.",
    "Links and the ellipsis show the sky focus ring on keyboard focus. Hover only changes color, and the menu's grow and fade are removed with reduced motion."
  ],
  "states": [
    "default",
    "collapsed",
    "menu-open"
  ],
  "files": [
    {
      "path": "ui/breadcrumb.tsx",
      "content": "\"use client\";\n\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport type { ComponentProps, ReactElement, ReactNode } from \"react\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from \"./dropdown-menu\";\n\nfunction cx(...classes: (string | false | null | undefined)[]) {\n  return classes.filter(Boolean).join(\" \");\n}\n\nconst focusRing = \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-500\";\n\nexport interface BreadcrumbProps extends ComponentProps<\"nav\"> {\n  /** Accessible name of the landmark. Change it when a page has more than one breadcrumb. */\n  \"aria-label\"?: string;\n}\n\n/** The breadcrumb landmark. Holds a single `BreadcrumbList`. */\nexport function Breadcrumb({ \"aria-label\": label = \"Breadcrumb\", className, ...props }: BreadcrumbProps) {\n  return <nav aria-label={label} className={cx(\"min-w-0\", className)} {...props} />;\n}\n\n/** The ordered trail. Wraps onto a second line when it runs out of room. */\nexport function BreadcrumbList({ className, ...props }: ComponentProps<\"ol\">) {\n  return (\n    <ol\n      className={cx(\n        \"m-0 flex min-w-0 list-none flex-wrap items-center gap-x-1 gap-y-1 p-0 text-sm text-zinc-500 dark:text-zinc-400\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\n/** One step of the trail: a `BreadcrumbLink`, `BreadcrumbPage`, or `BreadcrumbOverflow`. */\nexport function BreadcrumbItem({ className, ...props }: ComponentProps<\"li\">) {\n  return <li className={cx(\"inline-flex min-w-0 items-center gap-1.5\", className)} {...props} />;\n}\n\nexport interface BreadcrumbLinkProps extends useRender.ComponentProps<\"a\"> {}\n\n/**\n * A link to an ancestor page. Renders an `<a>`; pass `render={<Link href=\"…\" />}` to use your\n * router's link component. Hover and focus only change color, so the trail never shifts.\n */\nexport function BreadcrumbLink({ render, className, ...props }: BreadcrumbLinkProps) {\n  return useRender({\n    defaultTagName: \"a\",\n    render,\n    props: mergeProps<\"a\">(\n      {\n        className: cx(\n          \"-mx-1 inline-flex min-w-0 items-center gap-1.5 rounded-md px-1 py-0.5 no-underline\",\n          \"transition-colors duration-150 ease-out motion-reduce:transition-none\",\n          \"hover:text-zinc-950 dark:hover:text-white\",\n          \"[&_svg]:size-4 [&_svg]:shrink-0\",\n          focusRing,\n          className,\n        ),\n      },\n      props,\n    ),\n  });\n}\n\n/** The current page. Not a link; announced with `aria-current=\"page\"`. Long titles truncate. */\nexport function BreadcrumbPage({ className, ...props }: ComponentProps<\"span\">) {\n  return (\n    <span\n      aria-current=\"page\"\n      className={cx(\n        \"inline-flex min-w-0 items-center gap-1.5 truncate font-medium text-zinc-950 dark:text-white [&_svg]:size-4 [&_svg]:shrink-0\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\n/**\n * The mark between steps: a thin forward slash by default. Hidden from assistive technology,\n * since the list structure already conveys the order. Pass children to use your own mark.\n */\nexport function BreadcrumbSeparator({ className, children, ...props }: ComponentProps<\"li\">) {\n  return (\n    <li\n      role=\"presentation\"\n      aria-hidden=\"true\"\n      className={cx(\"inline-flex items-center text-zinc-950/25 dark:text-white/25 [&_svg]:size-3.5\", className)}\n      {...props}\n    >\n      {children ?? (\n        <svg viewBox=\"0 0 16 16\" fill=\"none\">\n          <path d=\"M10.25 2.75 5.75 13.25\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n        </svg>\n      )}\n    </li>\n  );\n}\n\nexport interface BreadcrumbOverflowLink {\n  /** Visible text of the hidden step. */\n  label: ReactNode;\n  /** Destination of the hidden step. */\n  href: string;\n  /** Replaces the `<a>` element, for example `<Link href=\"…\" />` for client-side routing. */\n  render?: ReactElement;\n}\n\nexport interface BreadcrumbOverflowProps extends Omit<ComponentProps<\"button\">, \"children\"> {\n  /** The steps hidden behind the ellipsis, in trail order. */\n  items: BreadcrumbOverflowLink[];\n  /** Accessible name of the ellipsis button. Defaults to \"Show N more pages\". */\n  \"aria-label\"?: string;\n}\n\n/**\n * Collapses the middle of a long trail into an ellipsis button. Pressing it opens a menu of the\n * hidden steps, which are real links, so they keep working with middle-click and the keyboard.\n */\nexport function BreadcrumbOverflow({ items, \"aria-label\": label, className, ...props }: BreadcrumbOverflowProps) {\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        aria-label={label ?? `Show ${items.length} more ${items.length === 1 ? \"page\" : \"pages\"}`}\n        className={cx(\n          \"-mx-0.5 inline-flex h-6 w-7 items-center justify-center rounded-md text-zinc-500 dark:text-zinc-400\",\n          \"transition-[background-color,color] duration-150 ease-out motion-reduce:transition-none\",\n          \"hover:bg-zinc-950/[0.05] hover:text-zinc-950 dark:hover:bg-white/[0.08] dark:hover:text-white\",\n          \"data-[popup-open]:bg-zinc-950/[0.06] data-[popup-open]:text-zinc-950 dark:data-[popup-open]:bg-white/[0.09] dark:data-[popup-open]:text-white\",\n          focusRing,\n          className,\n        )}\n        {...props}\n      >\n        <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"currentColor\" className=\"size-4\">\n          <circle cx=\"3.5\" cy=\"8\" r=\"1.1\" />\n          <circle cx=\"8\" cy=\"8\" r=\"1.1\" />\n          <circle cx=\"12.5\" cy=\"8\" r=\"1.1\" />\n        </svg>\n      </DropdownMenuTrigger>\n      <DropdownMenuContent align=\"start\" className=\"min-w-44\">\n        {items.map((item) => (\n          <DropdownMenuItem key={item.href} render={item.render ?? <a href={item.href} />} className=\"no-underline\">\n            <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\">\n              <path\n                d=\"M2.5 4.75v-.5c0-.69.56-1.25 1.25-1.25h2.6l1.4 1.5h4.5c.69 0 1.25.56 1.25 1.25v5.5c0 .69-.56 1.25-1.25 1.25h-8.5c-.69 0-1.25-.56-1.25-1.25z\"\n                stroke=\"currentColor\"\n                strokeWidth=\"1.5\"\n                strokeLinejoin=\"round\"\n              />\n            </svg>\n            <span className=\"truncate\">{item.label}</span>\n          </DropdownMenuItem>\n        ))}\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n"
    }
  ],
  "example": {
    "content": "import {\n  Breadcrumb,\n  BreadcrumbItem,\n  BreadcrumbLink,\n  BreadcrumbList,\n  BreadcrumbOverflow,\n  BreadcrumbPage,\n  BreadcrumbSeparator,\n} from \"@/components/shaken/ui/breadcrumb\";\n\nexport default function BreadcrumbExample() {\n  return (\n    <div className=\"flex w-full max-w-lg flex-col gap-6\">\n      <Breadcrumb aria-label=\"Settings breadcrumb\">\n        <BreadcrumbList>\n          <BreadcrumbItem>\n            <BreadcrumbLink href=\"#workspace\">\n              <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\">\n                <path\n                  d=\"M2.75 7.1 8 2.75l5.25 4.35v5.65c0 .28-.22.5-.5.5H9.5v-3.5h-3v3.5H3.25a.5.5 0 0 1-.5-.5z\"\n                  stroke=\"currentColor\"\n                  strokeWidth=\"1.5\"\n                  strokeLinejoin=\"round\"\n                />\n              </svg>\n              Northwind\n            </BreadcrumbLink>\n          </BreadcrumbItem>\n          <BreadcrumbSeparator />\n          <BreadcrumbItem>\n            <BreadcrumbLink href=\"#settings\">Settings</BreadcrumbLink>\n          </BreadcrumbItem>\n          <BreadcrumbSeparator />\n          <BreadcrumbItem>\n            <BreadcrumbPage>Members</BreadcrumbPage>\n          </BreadcrumbItem>\n        </BreadcrumbList>\n      </Breadcrumb>\n\n      <Breadcrumb aria-label=\"Deployment breadcrumb\">\n        <BreadcrumbList>\n          <BreadcrumbItem>\n            <BreadcrumbLink href=\"#projects\">Projects</BreadcrumbLink>\n          </BreadcrumbItem>\n          <BreadcrumbSeparator />\n          <BreadcrumbItem>\n            <BreadcrumbOverflow\n              items={[\n                { label: \"billing-api\", href: \"#billing-api\" },\n                { label: \"Environments\", href: \"#environments\" },\n                { label: \"Production\", href: \"#production\" },\n              ]}\n            />\n          </BreadcrumbItem>\n          <BreadcrumbSeparator />\n          <BreadcrumbItem>\n            <BreadcrumbLink href=\"#deployments\">Deployments</BreadcrumbLink>\n          </BreadcrumbItem>\n          <BreadcrumbSeparator />\n          <BreadcrumbItem>\n            <BreadcrumbPage className=\"font-mono text-[13px]\">dpl_7Hq2xK9</BreadcrumbPage>\n          </BreadcrumbItem>\n        </BreadcrumbList>\n      </Breadcrumb>\n    </div>\n  );\n}\n"
  }
}
