# Breadcrumb URL: /docs/ui/components/breadcrumb A navigation aid that shows users their current location within a website or application hierarchy. *** title: Breadcrumb description: A navigation aid that shows users their current location within a website or application hierarchy. ---------------------------------------------------------------------------------------------------------------- import { PreviewContainer } from "@/components/PreviewContainer"; import { TypeTable } from "fumadocs-ui/components/type-table"; import { Tabs, Tab } from "fumadocs-ui/components/tabs"; import { Home, ChevronRight, Slash } from "lucide-react"; import { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, } from "@/components/ui/breadcrumb"; Home Documentation Breadcrumb ```tsx Home Documentation Breadcrumb ``` ## Installation Install following dependencies: ```package-install npm install @radix-ui/react-slot class-variance-authority lucide-react ``` Copy and paste the following code into your project. ```tsx title="components/ui/breadcrumb.tsx" "use client"; import * as React from "react"; import { Slot } from "@radix-ui/react-slot"; import { cva, type VariantProps } from "class-variance-authority"; import { ChevronRight, MoreHorizontal } from "lucide-react"; import { cn } from "@/lib/utils"; const breadcrumbVariants = cva("", { variants: {}, defaultVariants: {}, }); const breadcrumbListVariants = cva( "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground", { variants: { size: { sm: "text-xs gap-1", default: "text-sm gap-1.5", lg: "text-base gap-2", }, }, defaultVariants: { size: "default", }, } ); const breadcrumbItemVariants = cva("inline-flex items-center gap-1.5", { variants: {}, defaultVariants: {}, }); const breadcrumbLinkVariants = cva( "transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm flex items-center gap-1", { variants: {}, defaultVariants: {}, } ); const breadcrumbPageVariants = cva( "font-normal text-foreground", { variants: { variant: { default: "", highlighted: "font-medium", muted: "text-muted-foreground", }, }, defaultVariants: { variant: "default", }, } ); export interface BreadcrumbProps extends React.ComponentPropsWithoutRef<"nav"> { separator?: React.ReactNode; } export interface BreadcrumbListProps extends React.ComponentPropsWithoutRef<"ol">, VariantProps {} export interface BreadcrumbItemProps extends React.ComponentPropsWithoutRef<"li"> {} export interface BreadcrumbLinkProps extends React.ComponentPropsWithoutRef<"a"> { asChild?: boolean; } export interface BreadcrumbPageProps extends React.ComponentPropsWithoutRef<"span">, VariantProps {} export interface BreadcrumbSeparatorProps extends React.ComponentProps<"li"> { children?: React.ReactNode; } export interface BreadcrumbEllipsisProps extends React.ComponentProps<"span"> {} const Breadcrumb = React.forwardRef( ({ className, ...props }, ref) => (