{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "breadcrumb-separator",
"type": "registry:ui",
"title": "Breadcrumb Separator",
"description": "Breadcrumb navigation with customizable separators (chevron, slash, dot, arrow, dash).",
"dependencies": [
"lucide-react"
],
"files": [
{
"path": "registry/ruixenui/breadcrumb-separator.tsx",
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\n\n/* ═══════════════════════════════════════════════════════════\n Breadcrumb Separator — Reactive hover-cascade breadcrumb.\n\n The separator isn't decoration — it's a directional cue.\n When you hover a parent item, you're expressing intent to\n \"go back.\" Items after the hovered one fade and shift right,\n as if they'd be popped from the navigation stack. The\n separator adjacent to the hovered item scales with a spring\n overshoot, reinforcing the spatial metaphor.\n\n Two transition curves:\n • Separator scale: cubic-bezier(0.34, 1.56, 0.64, 1) — spring\n • Fade cascade: cubic-bezier(0.16, 1, 0.3, 1) — smooth ease-out\n ═══════════════════════════════════════════════════════════ */\n\ntype SeparatorType = \"chevron\" | \"slash\" | \"dot\" | \"arrow\" | \"dash\";\n\ninterface BreadcrumbItem {\n label: string;\n href?: string;\n}\n\ninterface BreadcrumbSeparatorProps {\n items: BreadcrumbItem[];\n separator?: SeparatorType;\n className?: string;\n}\n\nfunction renderSeparator(type: SeparatorType) {\n if (type === \"chevron\") {\n return (\n \n );\n }\n\n const chars: Record = {\n slash: \"/\",\n dot: \"·\",\n arrow: \"→\",\n dash: \"—\",\n };\n\n return {chars[type]};\n}\n\nexport default function BreadcrumbSeparator({\n items,\n separator = \"chevron\",\n className,\n}: BreadcrumbSeparatorProps) {\n const [hoveredIndex, setHoveredIndex] = React.useState(null);\n\n if (items.length === 0) return null;\n\n return (\n \n );\n}\n\nexport {\n BreadcrumbSeparator as BreadcrumbSeparatorComponent,\n type BreadcrumbSeparatorProps,\n};\n",
"type": "registry:ui",
"target": "components/ruixen/breadcrumb-separator.tsx"
}
]
}