# Breadcrumbs **Category**: react **URL**: https://www.heroui.com/docs/react/components/breadcrumbs **Source**: https://raw.githubusercontent.com/heroui-inc/heroui/refs/heads/v3/apps/docs/content/docs/react/components/(navigation)/breadcrumbs.mdx > Navigation breadcrumbs showing the current page's location within a hierarchy *** ## Import ```tsx import { Breadcrumbs } from '@heroui/react'; ``` ### Usage ```tsx "use client"; import {Breadcrumbs} from "@heroui/react"; export default function BreadcrumbsBasic() { return ( Home Products Electronics Laptop ); } ``` ### Anatomy Import the Breadcrumbs component and access all parts using dot notation. ```tsx import { Breadcrumbs } from '@heroui/react'; export default () => ( Home Category Current Page ) ``` ### Navigation Levels ```tsx "use client"; import {Breadcrumbs} from "@heroui/react"; export default function BreadcrumbsLevel2() { return ( Home Current Page ); } ``` ```tsx "use client"; import {Breadcrumbs} from "@heroui/react"; export default function BreadcrumbsLevel3() { return ( Home Category Current Page ); } ``` ### Custom Separator ```tsx "use client"; import {Breadcrumbs} from "@heroui/react"; export default function BreadcrumbsCustomSeparator() { return ( } > Home Products Electronics Laptop ); } ``` ### Disabled State ```tsx "use client"; import {Breadcrumbs} from "@heroui/react"; export default function BreadcrumbsDisabled() { return ( Home Products Electronics Laptop ); } ``` ### Custom Render Function ```tsx "use client"; import {Breadcrumbs} from "@heroui/react"; export function CustomRenderFunction() { return (
    }>
  1. }> Home
  2. }> Products
  3. }> Electronics
  4. }> Laptop ); } ``` ## Styling ### Passing Tailwind CSS classes ```tsx import { Breadcrumbs } from '@heroui/react'; function CustomBreadcrumbs() { return ( Home Current ); } ``` ### Customizing the component classes To customize the Breadcrumbs component classes, you can use the `@layer components` directive.
    [Learn more](https://tailwindcss.com/docs/adding-custom-styles#adding-component-classes). ```css @layer components { .breadcrumbs { @apply gap-4 text-lg; } .breadcrumbs__link { @apply font-semibold; } .breadcrumbs__separator { @apply text-blue-500; } } ``` HeroUI follows the [BEM](https://getbem.com/) methodology to ensure component variants and states are reusable and easy to customize. ### CSS Classes The Breadcrumbs component uses these CSS classes ([View source styles](https://github.com/heroui-inc/heroui/blob/v3/packages/styles/components/breadcrumbs.css)): #### Base Classes - `.breadcrumbs` - Base breadcrumbs container - `.breadcrumbs__item` - Individual breadcrumb item wrapper - `.breadcrumbs__link` - Breadcrumb link element - `.breadcrumbs__separator` - Separator icon between items #### State Classes - `.breadcrumbs__link[data-current="true"]` - Current page indicator (not a link) ### Interactive States The component supports both CSS pseudo-classes and data attributes for flexibility: - **Current**: `[data-current="true"]` on link (indicates current page) - **Hover**: Link elements support standard hover states - **Disabled**: `isDisabled` prop disables all links ## API Reference ### Breadcrumbs Props | Prop | Type | Default | Description | |------|------|---------|-------------| | `separator` | `ReactNode` | chevron-right icon | Custom separator between breadcrumb items | | `isDisabled` | `boolean` | `false` | Whether all breadcrumb links are disabled | | `className` | `string` | - | Additional CSS classes | | `children` | `ReactNode` | - | The breadcrumb items | | `render` | `DOMRenderFunction` | - | Overrides the default DOM element with a custom render function| ### Breadcrumbs.Item Props | Prop | Type | Default | Description | |------|------|---------|-------------| | `href` | `string` | - | The URL to link to (omit for current page) | | `className` | `string` | - | Additional CSS classes | | `children` | `ReactNode \| RenderFunction` | - | Item content or render function | | `render` | `DOMRenderFunction` | - | Overrides the default DOM element with a custom render function| ## Accessibility Breadcrumbs uses React Aria Components' Breadcrumbs primitive, which provides: - Proper ARIA attributes for navigation landmarks - Current page indication via `aria-current="page"` - Keyboard navigation support - Screen reader announcements for navigation context The last breadcrumb item (without `href`) automatically becomes the current page indicator.