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

# Breadcrumb

Navigation`@rockshin/tao-ui`

[Examples](#examples)[API](#api)

Renders the user location in a hierarchy of pages or views.

## When to use

Use Breadcrumb near the top of a page when users need to understand or move through nested context.

**Recommended**

- Keep labels short and recognizable.
- Use links for ancestors and plain text for the current item.

**Avoid**

- Do not use Breadcrumb as primary navigation.

## Examples


### Basic usage
```tsx preview
import { Breadcrumb } from '@rockshin/tao-ui';

function BreadcrumbExample() {
  return (
    <Breadcrumb
      items={[
        { title: 'Home', href: '#breadcrumb-example-1' },
        { title: 'Components', href: '#breadcrumb-example-1' },
        { title: 'Breadcrumb' },
      ]}
    />
  );
}

export default BreadcrumbExample;
```

### Separators and collapsed paths
```tsx preview
import { Breadcrumb, Stack, TaoProvider } from '@rockshin/tao-ui';

function BreadcrumbSeparators() {
  const items = [
    { title: 'Home', href: '#breadcrumb-example-1' },
    { title: 'Settings', href: '#breadcrumb-example-1' },
    { title: 'Profile' },
  ];

  return (
    <Stack gap="md">
      <Breadcrumb separator="/" items={items} />
      <Breadcrumb separator="›" items={items} />
      <Breadcrumb
        maxItems={3}
        items={[
          { title: 'Home', href: '#breadcrumb-example-1' },
          { title: 'Workspace', href: '#breadcrumb-example-1' },
          { title: 'Projects', href: '#breadcrumb-example-1' },
          { title: 'tao-ui', href: '#breadcrumb-example-1' },
          { title: 'Settings' },
        ]}
      />
    </Stack>
  );
}

export default BreadcrumbSeparators;
```

### Disabled items and sizes
```tsx preview
import { Breadcrumb, Stack, TaoProvider } from '@rockshin/tao-ui';

function BreadcrumbStates() {
  const items = [
    { title: 'Home', href: '#breadcrumb-example-1' },
    { title: 'Archived', href: '#breadcrumb-example-1', disabled: true },
    { title: 'Item' },
  ];

  return (
    <Stack gap="md">
      <TaoProvider size="small">
        <Breadcrumb items={items} />
      </TaoProvider>
      <TaoProvider size="medium">
        <Breadcrumb items={items} />
      </TaoProvider>
      <TaoProvider size="large">
        <Breadcrumb items={items} />
      </TaoProvider>
    </Stack>
  );
}

export default BreadcrumbStates;
```

### Custom separators
Change `separator` without changing link or current-page semantics.
```tsx preview
import { Breadcrumb, Stack, TaoProvider } from '@rockshin/tao-ui';

export default function BreadcrumbCustomSeparator() {
  return (
    <Stack gap="md">
      <Breadcrumb
        separator="/"
        items={[
          { title: 'Home', href: '#breadcrumb-example-1' },
          { title: 'Docs', href: '#breadcrumb-example-1' },
          { title: 'Guide' },
        ]}
      />
      <Breadcrumb
        separator="›"
        items={[
          { title: 'Home', href: '#breadcrumb-example-1' },
          { title: 'Settings', href: '#breadcrumb-example-1' },
          { title: 'Profile' },
        ]}
      />
    </Stack>
  );
}
```

### Collapsed paths
`maxItems` collapses middle segments; open the overflow menu to reach hidden levels.
```tsx preview
import { Breadcrumb } from '@rockshin/tao-ui';

export default function BreadcrumbCollapsed() {
  return (
    <Breadcrumb
      maxItems={3}
      items={[
        { title: 'Home', href: '#breadcrumb-example-1' },
        { title: 'Group', href: '#breadcrumb-example-1' },
        { title: 'Section', href: '#breadcrumb-example-1' },
        { title: 'Subsection', href: '#breadcrumb-example-1' },
        { title: 'Current Page' },
      ]}
    />
  );
}
```

### Disabled items
Mark unavailable destinations with `disabled` while retaining the current page title.
```tsx preview
import { Breadcrumb } from '@rockshin/tao-ui';

export default function BreadcrumbDisabled() {
  return (
    <Breadcrumb
      items={[
        { title: 'Home', href: '#breadcrumb-example-1' },
        { title: 'Archived', href: '#breadcrumb-example-1', disabled: true },
        { title: 'Item' },
      ]}
    />
  );
}
```

### Custom link rendering
Use `itemRender` to integrate an application link component while retaining accessible link behavior.
```tsx preview
import { Breadcrumb } from '@rockshin/tao-ui';

export default function BreadcrumbCustomLink() {
  return (
    <Breadcrumb
      items={[
        { title: 'Home', key: 'home' },
        { title: 'Library', key: 'library' },
        { title: 'Data' },
      ]}
      itemRender={(item, { isLast }) =>
        isLast ? (
          item.title
        ) : (
          // Any custom element works — e.g. a router <Link>. Slot merges the
          // breadcrumb link styles onto it instead of adding another <a>.
          <a href="#breadcrumb-example-1">{item.title}</a>
        )
      }
    />
  );
}
```

### Breadcrumb sizes
Use TaoProvider `size` to match a compact toolbar or a spacious page header.
```tsx preview
import { Breadcrumb, Stack, TaoProvider } from '@rockshin/tao-ui';

export default function BreadcrumbSizes() {
  return (
    <Stack gap="md">
      {(['small', 'medium', 'large'] as const).map((size) => (
        <div key={size}>
          <p
            style={{
              fontSize: 13,
              color: 'var(--tao-color-text-secondary)',
              marginBottom: 4,
            }}
          >
            {size}
          </p>
          <TaoProvider size={size}>
            <Breadcrumb
              items={[
                { title: 'Home', href: '#breadcrumb-example-1' },
                { title: 'List', href: '#breadcrumb-example-1' },
                { title: 'Detail' },
              ]}
            />
          </TaoProvider>
        </div>
      ))}
    </Stack>
  );
}
```

## API


### [#](#breadcrumb)Breadcrumb



| Property | Description | Type | Default Value |
| --- | --- | --- | --- |
| items | Breadcrumb path, root first. The last item renders as the current page. | `BreadcrumbItemType[]` **(Required)** | `-` |
| separator | Separator between items. Defaults to a chevron, like shadcn. | `ReactNode` | `-` |
| maxItems | Collapse the middle of long paths into an ellipsis once the number of
items exceeds this value. Shows the first item and the last
`maxItems - 1` items. | `number | undefined` | `-` |
| itemRender | Custom renderer for an item's content. Return a React element (e.g. a
router `<Link>`) and its props are merged onto the breadcrumb link via
Radix Slot — no extra `<a>` wrapper is added. | `((item: BreadcrumbItemType, info: { index: number; isLast: boolean; items: BreadcrumbItemType[]; }) => ReactNode) | undefined` | `-` |
| className | Additional css class | `string | undefined` | `-` |
| style | Additional style | `CSSProperties | undefined` | `-` |

