> Leaf UI 0.17.3 · Package: @ifhover/leaf-ui · Source: c3221834f84f2f48481a2054026b713456f8e5dc
> Browser documentation: https://ifhover.github.io/leaf-ui/en/components/breadcrumb.html

> For AI agents: the complete documentation index is available at https://ifhover.github.io/leaf-ui/en/llms.txt, the full documentation bundle is available at https://ifhover.github.io/leaf-ui/en/llms-full.txt.

# Breadcrumb

Show the current page within a navigation hierarchy.


## Basic usage

The final item represents the current page and can omit `href`. If `title` is already a router Link, omit `href` to avoid nested links.


1. [Home](https://ifhover.github.io/leaf-ui/en/)
1. [Components](https://ifhover.github.io/leaf-ui/en/components/index.html)
1. Breadcrumb

basic.tsx

Copy code

```tsx lineNumbers file="../../../src/examples/en/breadcrumb/basic.tsx"
import { Breadcrumb } from '@ifhover/leaf-ui';

export function BreadcrumbBasic() {
  return (
    <Breadcrumb
      items={[
        { title: 'Home', href: 'https://ifhover.github.io/leaf-ui/en/' },
        { title: 'Components', href: 'https://ifhover.github.io/leaf-ui/en/components/index.html' },
        { title: 'Breadcrumb' },
      ]}
    />
  );
}
```

Expand code


## Examples

### Separator

Use `separator` to set the content between path levels.


1. [Home](https://ifhover.github.io/leaf-ui/en/)
1. /[Components](https://ifhover.github.io/leaf-ui/en/components/index.html)
1. /Breadcrumb

separator.tsx

Copy code

```tsx lineNumbers file="../../../src/examples/en/breadcrumb/separator.tsx"
import { Breadcrumb } from '@ifhover/leaf-ui';

export function BreadcrumbSeparator() {
  return (
    <Breadcrumb
      separator="/"
      items={[
        { title: 'Home', href: 'https://ifhover.github.io/leaf-ui/en/' },
        { title: 'Components', href: 'https://ifhover.github.io/leaf-ui/en/components/index.html' },
        { title: 'Breadcrumb' },
      ]}
    />
  );
}
```

Expand code

### Collapse long paths

Set `maxItems` to collapse a long path. The ellipsis button opens the hidden links.


1. [Home](https://ifhover.github.io/leaf-ui/en/)
1. 
1. API

capabilities.tsx

Copy code

```tsx lineNumbers file="../../../src/examples/en/breadcrumb/capabilities.tsx"
import { Breadcrumb } from '@ifhover/leaf-ui';

export function Capabilities() {
  return (
    <Breadcrumb
      aria-label="Collapsed documentation path"
      items={[
        { title: 'Home', href: 'https://ifhover.github.io/leaf-ui/en/' },
        { title: 'Components', href: 'https://ifhover.github.io/leaf-ui/en/components/index.html' },
        { title: 'Breadcrumb', href: '#basic-usage' },
        { title: 'API' },
      ]}
      maxItems={3}
    />
  );
}
```

Expand code


## API

### Breadcrumb API

Configuration for path levels, separators and collapsing intermediate entries.

| Property              | Type                                                                        | Default        | Description                                                                                                  |
| --------------------- | --------------------------------------------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------ |
| `items`               | `readonly `[`BreadcrumbItem`](#breadcrumbitem)`[]`                          | Required       | Path items                                                                                                   |
| `separator`           | `ReactNode`                                                                 | ChevronRight   | Separator                                                                                                    |
| `maxItems`            | `number`                                                                    | `Infinity`     | Collapse middle entries above this count; the minimum threshold is 3 and entries do not collapse by default. |
| `itemsBeforeCollapse` | `number`                                                                    | `1`            | Leading items retained after collapse.                                                                       |
| `itemsAfterCollapse`  | `number`                                                                    | `1`            | Trailing items retained after collapse.                                                                      |
| `itemRender`          | `(item: `[`BreadcrumbItem`](#breadcrumbitem)`, index: number) => ReactNode` | —              | Customize item content.                                                                                      |
| `aria-label`          | `string`                                                                    | Locale default | Navigation label                                                                                             |

### BreadcrumbItem

A path level defined through `items`.

| Property | Type                                                                                                      | Default  | Description                                                |
| -------- | --------------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------- |
| `key`    | `string`                                                                                                  | —        | Stable identifier                                          |
| `title`  | `ReactNode`                                                                                               | Required | Page title                                                 |
| `icon`   | `ReactNode`                                                                                               | —        | Leading icon                                               |
| `menu`   | `readonly `[`DropdownItem`](https://ifhover.github.io/leaf-ui/en/components/dropdown.md#dropdownitem)`[]` | —        | Dropdown items for a breadcrumb.                           |
| `href`   | `string`                                                                                                  | —        | Link destination.                                          |
| `target` | `string`                                                                                                  | —        | Link target, following the native anchor target attribute. |
