Breadcrumb Separator
ruixen-ui/breadcrumb-separatorFreeComponent
Breadcrumb navigation with customizable separators (chevron, slash, dot, arrow, dash).
Live preview
live · rendered by the registry
Rendered by ruixen-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ruixen.com/r/breadcrumb-separator.jsonSource
1"use client";23import * as React from "react";4import { cn } from "@/lib/utils";56/* ═══════════════════════════════════════════════════════════7 Breadcrumb Separator — Reactive hover-cascade breadcrumb.89 The separator isn't decoration — it's a directional cue.10 When you hover a parent item, you're expressing intent to11 "go back." Items after the hovered one fade and shift right,12 as if they'd be popped from the navigation stack. The13 separator adjacent to the hovered item scales with a spring14 overshoot, reinforcing the spatial metaphor.1516 Two transition curves:17 • Separator scale: cubic-bezier(0.34, 1.56, 0.64, 1) — spring18 • Fade cascade: cubic-bezier(0.16, 1, 0.3, 1) — smooth ease-out19 ═══════════════════════════════════════════════════════════ */2021type SeparatorType = "chevron" | "slash" | "dot" | "arrow" | "dash";2223interface BreadcrumbItem {24 label: string;25 href?: string;26}2728interface BreadcrumbSeparatorProps {29 items: BreadcrumbItem[];30 separator?: SeparatorType;31 className?: string;32}3334function renderSeparator(type: SeparatorType) {35 if (type === "chevron") {36 return (37 <svg width="14" height="14" viewBox="0 0 14 14" fill="none">38 <path39 d="M5.25 3.5L8.75 7L5.25 10.5"40 stroke="currentColor"41 strokeWidth="1.5"42 strokeLinecap="round"43 strokeLinejoin="round"44 />45 </svg>46 );47 }4849 const chars: Record<string, string> = {50 slash: "/",51 dot: "·",52 arrow: "→",53 dash: "—",54 };5556 return <span className="text-xs leading-none">{chars[type]}</span>;57}5859export default function BreadcrumbSeparator({60 items,61 separator = "chevron",62 className,63}: BreadcrumbSeparatorProps) {64 const [hoveredIndex, setHoveredIndex] = React.useState<number | null>(null);6566 if (items.length === 0) return null;6768 return (69 <nav aria-label="Breadcrumb" className={cn("", className)}>70 <ol71 className="flex flex-wrap items-center gap-1"72 onMouseLeave={() => setHoveredIndex(null)}73 >74 {items.map((item, index) => {75 const isLast = index === items.length - 1;76 const isLink = !!item.href && !isLast;77 const isHovered = hoveredIndex === index;78// … truncated
What it pulls in
npm packages
Files it writes
More from ruixen-ui
All 417 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Editorial Accordionaccordion-editorial | ruixen-ui | Components | Free | no deps | |
| Indexed Accordionaccordion-indexed | ruixen-ui | Components | Free | 1 dep | |
| Account Menuaccount-menu | ruixen-ui | Components | Free | 1 dep | |
| Action Toolbaraction-toolbar | ruixen-ui | Components | Free | 1 dep | |
| Add Task Sheetadd-task-sheet | ruixen-ui | Components | Free | 1 dep | |
| Add To Cart Buttonadd-to-cart-button | ruixen-ui | Components | Free | 1 dep | |
| AI Chat Inputai-chat-input | ruixen-ui | Components | Free | 1 dep | |
| Animated Highlight Textanimated-highlight-text | ruixen-ui | Components | Free | 1 dep |
