---
title: "Breadcrumb"
slug: "breadcrumb"
abstract: "Describes the anatomy, use and API reference of Search Breadcrumb primitive UI component."
---
# Breadcrumb

Primitive UI components in Search UI Components package, are headless, building blocks used to create the headless widget templates for React applications. You can use them to scaffold your custom widgets.

This topic describes the anatomy, API reference, and variations of the `Breadcrumb` primitive component.

<details>
<summary><h2>Anatomy</h2></summary>

```tsx
import { Breadcrumb } from '@sitecore-search/ui';

const MyBreadcrumbComponent = () => (
    <Breadcrumb.Root>
        <Breadcrumb.Navigation>
            <Breadcrumb.List>
                <Breadcrumb.Item>
                    <Breadcrumb.Link href="#">
                        Item 1
                    </Breadcrumb.Link>
                    <Breadcrumb.Separator value="/"></Breadcrumb.Separator>
                </Breadcrumb.Item>
                <Breadcrumb.Item>
                    <Breadcrumb.Link aria-current='page' href="#">
                        Item 2
                    </Breadcrumb.Link>
                </Breadcrumb.Item>
            </Breadcrumb.List>
        <Breadcrumb.Navigation>
    </Breadcrumb.Root>
);
```

</details>

<details>
<summary><h2>Using the component</h2></summary>

The following tabs describe use of the`Breadcrumb` primitive component.

### Plain component { .notintoc }

In your React application, paste the following code block then modify the primitives to match your needs.

![Screenshot of a plain Breadcrumb primitive component.](https://doc.sitecore.com/api/markdown-image/search/en/developers/search-js-sdk-for-react/images/breadcrumb-PLAIN.png)

```tsx
() => {
  return (
    <Breadcrumb.Root>
      <Breadcrumb.Navigation>
        <Breadcrumb.List>
          <Breadcrumb.Item>
            <Breadcrumb.Link href="#" onClick={(e) => e.preventDefault()}>
              Item 1
            </Breadcrumb.Link>
            <Breadcrumb.Separator></Breadcrumb.Separator>
          </Breadcrumb.Item>
          <Breadcrumb.Item>
            <Breadcrumb.Link href="#" onClick={(e) => e.preventDefault()}>
              Item 2
            </Breadcrumb.Link>
          </Breadcrumb.Item>
        </Breadcrumb.List>
      </Breadcrumb.Navigation>
    </Breadcrumb.Root>
  );
}
```

### With separators { .notintoc }

In your React application, paste the following code block then modify the primitives to match your needs.

![Screenshot of a Breadcrumb primitive component with separators.](https://doc.sitecore.com/api/markdown-image/search/en/developers/search-js-sdk-for-react/images/breadcrumb-separaTOR.png)

```tsx
() => {
  const StyledRoot = styled(Breadcrumb.Root)``;

  const StyledList = styled(Breadcrumb.List)`
    display: flex;
    list-style: none;
  `;

  const StyledLink = styled(Breadcrumb.Link)`
    text-decoration: none;
    color: ${theme.vars.palette.primary.main};
    &:hover {
      text-decoration: none;
      color: ${theme.vars.palette.primary.light};
    }
    &:focus {
      text-decoration: none;
      color: ${theme.vars.palette.primary.light};
    }
    &[data-disabled] {
      color: ${theme.vars.palette.grey['400']};
      pointer-events: none;
    }
  `;
  const StyledSeparator = styled(Breadcrumb.Separator)`
    margin: auto ${theme.vars.spacing.xs};
  `;

  return (
    <StyledRoot>
      <Breadcrumb.Navigation>
        <StyledList>
          <Breadcrumb.Item>
            <StyledLink href="#" onClick={(e) => e.preventDefault()}>
              Link 1
            </StyledLink>
            <StyledSeparator value=">"></StyledSeparator>
          </Breadcrumb.Item>
          <Breadcrumb.Item>
            <StyledLink href="#" onClick={(e) => e.preventDefault()} disabled={true}>
              Link 2
            </StyledLink>
          </Breadcrumb.Item>
        </StyledList>
      </Breadcrumb.Navigation>
    </StyledRoot>
  );
}
```

### With disabled items { .notintoc }

In your React application, paste the following code block then modify the primitives to match your needs.

![Screenshot of Breadcrumb primitive component with disabled items.](https://doc.sitecore.com/api/markdown-image/search/en/developers/search-js-sdk-for-react/images/breadcrumb-disabled.png)

```tsx
() => {
  const StyledRoot = styled(Breadcrumb.Root)``;

  const StyledList = styled(Breadcrumb.List)`
    display: flex;
    list-style: none;
  `;

  const StyledLink = styled(Breadcrumb.Link)`
    text-decoration: none;
    color: ${theme.vars.palette.primary.main};
    &:hover {
      text-decoration: none;
      color: ${theme.vars.palette.primary.light};
    }
    &:focus {
      text-decoration: none;
      color: ${theme.vars.palette.primary.light};
    }
    &[data-disabled] {
      color: ${theme.vars.palette.grey['400']};
      pointer-events: none;
    }
  `;
  const StyledSeparator = styled(Breadcrumb.Separator)`
    margin: auto ${theme.vars.spacing.xs};
  `;

  return (
    <StyledRoot>
      <Breadcrumb.Navigation>
        <StyledList>
          <Breadcrumb.Item>
            <StyledLink href="#" onClick={(e) => e.preventDefault()}>
              Link 1
            </StyledLink>
            <StyledSeparator value=">"></StyledSeparator>
          </Breadcrumb.Item>
          <Breadcrumb.Item>
            <StyledLink href="#" onClick={(e) => e.preventDefault()} disabled={true}>
              Link 2
            </StyledLink>
          </Breadcrumb.Item>
        </StyledList>
      </Breadcrumb.Navigation>
    </StyledRoot>
  );
}
```

</details>

<details>
<summary><h2>API reference</h2></summary>

This section describes the component or component parts displayed in the anatomy structure. For every component, you will find:

- Components to which you can add it as a child.
- Components you can add as its child.
- Details of any properties you can set.

### Breadcrumb.Root

The `Breadcrumb.Root` component contains all the breadcrumbs.

Children: `Breadcrumb.Navigation`

| Name | Description |
| --- | --- |
| `article` | The article object |

### Breadcrumb.Navigation

The `Breadcrumb.Navigation` component represents the `nav` HTML element. A `nav` element labeled *Breadcrumb* identifies the structure as a breadcrumb trail and makes it a navigation landmark so that it is easy to locate.

Parent: `Breadcrumb.Root`

Children: `Breadcrumb.List`

### Breadcrumb.List

The `Breadcrumb.List `component is an ol(ordered list) HTML element.

Parent: `Breadcrumb.Root`

Children: `Breadcrumb.Item`

### Breadcrumb.Item

The `Breadcrumb.Item` component lists an item's content using links and separators.

Parent: `Breadcrumb.List`

Children: `Breadcrumb.Link` and `Breadcrumb.Separator`.

### Breadcrumb.Link

The Breadcrumb.Link component is an anchor HTML element.

Parent: `Breadcrumb.Item`

### Breadcrumb.Separator

The `Breadcrumb.Separator` component separates breadcrumb items. It is an empty element by default. The separators are part of the visual presentation that signifies the breadcrumb trail, which is already semantically represented by the `nav` element with its label of *Breadcrumb*. So, using a display technique that is not represented in the accessibility tree used by screen readers prevents redundant and potentially distracting verbosity.

Parent: `Breadcrumb.Item`

| Name | Description |
| --- | --- |
| `value` | String value of the separator. |

</details>

## API reference

### Breadcrumb.Root

The Breadcrumb.Root component contains all the breadcrumbs.

Children: Breadcrumb.Navigation

### Breadcrumb.Navigation

The Breadcrumb.Navigation component represents nav HTML element. A nav element labeled Breadcrumb identifies the structure as a breadcrumb trail and makes it a navigation landmark so that it is easy to locate.

Parent: Breadcrumb.Root

Children: Breadcrumb.List

### Breadcrumb.List

The Breadcrumb.List component is an ol(ordered list) HTML element.

Parent: Breadcrumb.Root

Children: Breadcrumb.Item

### Breadcrumb.Item

The Breadcrumb.Item component lists an item's content using links and separators.

Parent: Breadcrumb.List

Children: Breadcrumb.Link, and Breadcrumb.Separator

### Breadcrumb.Link

The Breadcrumb.Link component is an anchor HTML element.

Parent: Breadcrumb.Item

### Breadcrumb.Separator

The Breadcrumb.Separator component separates breadcrumb items. It is an empty element by default. The separators are part of the visual presentation that signifies the breadcrumb trail, which is already semantically represented by the nav element with its label of Breadcrumb. So, using a display technique that is not represented in the accessibility tree used by screen readers prevents redundant and potentially distracting verbosity.

Parent: Breadcrumb.Item

| Name | Description |
| --- | --- |
| value | Value of the separator. |