Breadcrumb
WebDisplays the path to the current resource using a hierarchy of links.
Installation
pnpm dlx cubix-ui@latest add breadcrumb --base ariaUsage
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/cubix/breadcrumb"
<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbLink href="/">خانه</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbLink href="/docs/components">کامپوننتها</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbPage>مسیر</BreadcrumbPage>
</BreadcrumbItem>
</BreadcrumbList>
</Breadcrumb>
Composition
Keep the last item as BreadcrumbPage so the current page is announced correctly. The default chevron flips in RTL.
Breadcrumb
└── BreadcrumbList
├── BreadcrumbItem
│ └── BreadcrumbLink
├── BreadcrumbSeparator
├── BreadcrumbItem
│ └── BreadcrumbLink
├── BreadcrumbSeparator
└── BreadcrumbItem
└── BreadcrumbPageAccessibility
The root is a navigation landmark named مسیر by default. Override aria-label when the trail needs a more specific name. Separators are hidden from assistive technology, and the current page uses aria-current="page".
Examples
With icon
Place an icon inside BreadcrumbLink before the text. It is sized to 20px and spaced from the label automatically.
Separator
Pass a custom child to BreadcrumbSeparator to replace the default chevron.
Collapsed
Use BreadcrumbEllipsis to show a collapsed middle when the path is too long.
Dropdown
Compose BreadcrumbEllipsis with a DropdownMenu when the hidden segments should still be reachable.
Link component
Pass render={<Link />} to use your routing library's link. The docs adapter maps this to asChild on Radix.
API Reference
Note: Parts render data-slot attributes (breadcrumb, breadcrumb-list, breadcrumb-item, breadcrumb-link, breadcrumb-page, breadcrumb-separator, breadcrumb-ellipsis) for targeting in tests and parent selectors. Keep the last item as BreadcrumbPage. Use the same props on Base UI, React Aria, and Radix.
Breadcrumb
| Prop | Type | Default | Description |
|---|---|---|---|
| aria-label | string | "مسیر" | Accessible name for the navigation landmark. |
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |
| children | React.ReactNode | - | Usually a BreadcrumbList of items, separators, and the page. |
BreadcrumbList
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |
BreadcrumbItem
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |
BreadcrumbLink
| Prop | Type | Default | Description |
|---|---|---|---|
| href | string | - | Destination for the default anchor. Ignored when render is set. |
| render | React.ReactElement | - | Base UI / React Aria: render the link as another element, such as a Next.js Link. |
| asChild | boolean | - | Radix: merge props onto the child element instead of rendering an anchor. |
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |
BreadcrumbPage
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |
| children | React.ReactNode | - | The current page label. Not a link. |
BreadcrumbSeparator
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode | - | Custom separator. Defaults to a chevron when omitted. |
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |
BreadcrumbEllipsis
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |