# Breadcrumb

Shows where the user is in the page hierarchy and lets them go back up, on a single row.

Tabs: [Guidelines](/components/web/breadcrumb/breadcrumb.guidelines.md) · [Code](/components/web/breadcrumb/breadcrumb.code.md)

## Basic usage

```tsx
import {Breadcrumb} from '@pleo-io/telescope'

export const SsoBreadcrumb = () => (
    <Breadcrumb aria-label="Breadcrumb">
        <Breadcrumb.Item href="/settings">Settings</Breadcrumb.Item>
        <Breadcrumb.Item href="/settings/people-access">People & access</Breadcrumb.Item>
        <Breadcrumb.Item>Single sign-on</Breadcrumb.Item>
    </Breadcrumb>
)
```

The last `Breadcrumb.Item` is the current page: it renders as text with `aria-current="page"`, so it needs no `href`. Pass the items directly as children; wrapping them in your own components or fragments hides them from `Breadcrumb`.

See the [API reference](https://telescope.pleo.io/components/web/breadcrumb/breadcrumb.code#api-reference) for all props and [Guidelines](https://telescope.pleo.io/components/web/breadcrumb/breadcrumb.guidelines) for when and why to use the various options.

***

## Examples

### React Router

Use `as` and `to` to render the items as react-router links:

```tsx
import {Link} from 'react-router'
import {Breadcrumb} from '@pleo-io/telescope'

export const SsoBreadcrumb = () => (
    <Breadcrumb aria-label="Breadcrumb">
        <Breadcrumb.Item as={Link} to="/settings">
            Settings
        </Breadcrumb.Item>
        <Breadcrumb.Item>People & access</Breadcrumb.Item>
    </Breadcrumb>
)
```

The pages in the "…" menu use the same `as` and `to`, so collapsed items navigate the same way.

### Collapsing and truncating

Collapsing is automatic. Four levels collapse when they do not fit, and trails with more than four levels are always collapsed, keeping the first item and the last two. Labels are truncated with an ellipsis and shown in a tooltip when they are cut off. Don't wrap the breadcrumb in a container that allows it to overflow; give it the width of the page content.

***

## Accessibility

- `aria-label` is required: it names the navigation landmark. Pass a translated string.
- The label of the "…" button comes from the `Breadcrumb.MoreButton` translation of the `TelescopeProvider`. Provide it in every language you support.

## API reference

Shows where the user is in the page hierarchy and lets them go back up. The trail always stays on one row: when it does not fit, the items between the first one and the last two collapse into a menu, and then the labels are truncated.

#### `aria-label` (required)

Type: `string`

Default: -

Accessible name of the navigation landmark. Describe what the trail is, for example "Breadcrumb", and translate it.

#### `children` (required)

Type: `ReactNode`

##### Allowed values

- `null`
- `string`
- `number`
- `bigint`
- `false`
- `true`
- `ReactElement<unknown, string | JSXElementConstructor<any>>`
- `Iterable<ReactNode>`
- `ReactPortal`
- `Promise<AwaitedReactNode>`

Default: -

The trail, as `Breadcrumb.Item` elements in order from the root to the current page. The last item is always the current page.

### Breadcrumb.Item

This component doesn't accept any custom props.
