--- title: Breadcrumb description: Displays the path to the current resource using a hierarchy of links. component: true --- ## Installation CLI Manual ```bash npx shadcn@latest add breadcrumb ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@/components/ui/breadcrumb" ``` ```tsx showLineNumbers Home Components Breadcrumb ``` ## Examples ### Custom separator Use a custom component as `children` for `` to create a custom separator. ```tsx showLineNumbers {1,10-12} import { SlashIcon } from "lucide-react" ... Home Components ``` --- ### Dropdown You can compose `` with a `` to create a dropdown in the breadcrumb. ```tsx showLineNumbers {1-6,11-21} import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" ... Components Documentation Themes GitHub ``` --- ### Collapsed We provide a `` component to show a collapsed state when the breadcrumb is too long. ```tsx showLineNumbers {1,9} import { BreadcrumbEllipsis } from "@/components/ui/breadcrumb" ... {/* ... */} {/* ... */} ``` --- ### Link component To use a custom link component from your routing library, you can use the `asChild` prop on ``. ```tsx showLineNumbers {1,8-10} import Link from "next/link" ... Home {/* ... */} ``` --- ### Responsive Here's an example of a responsive breadcrumb that composes `` with ``, ``, and ``. It displays a dropdown on desktop and a drawer on mobile.