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, and this page is available as Markdown at https://ifhover.github.io/leaf-ui/en/components/breadcrumb.md.

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.

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' },
      ]}
    />
  );
}

Examples

Separator

Use separator to set the content between path levels.

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' },
      ]}
    />
  );
}

Collapse long paths

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

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}
    />
  );
}

API

Configuration for path levels, separators and collapsing intermediate entries.

PropertyTypeDefaultDescription
itemsreadonly BreadcrumbItem[]RequiredPath items
separatorReactNodeChevronRightSeparator
maxItemsnumberInfinityCollapse middle entries above this count; the minimum threshold is 3 and entries do not collapse by default.
itemsBeforeCollapsenumber1Leading items retained after collapse.
itemsAfterCollapsenumber1Trailing items retained after collapse.
itemRender(item: BreadcrumbItem, index: number) => ReactNode—Customize item content.
aria-labelstringLocale defaultNavigation label

A path level defined through items.

PropertyTypeDefaultDescription
keystring—Stable identifier
titleReactNodeRequiredPage title
iconReactNode—Leading icon
menureadonly DropdownItem[]—Dropdown items for a breadcrumb.
hrefstring—Link destination.
targetstring—Link target, following the native anchor target attribute.