# Breadcrumb

Displays the path to the current resource using a hierarchy of links.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).





<ComponentPreview name="breadcrumb-demo">
  <BreadcrumbDemo />
</ComponentPreview>

## Installation [#installation]

<Tabs defaultValue="cli">
  <TabsList>
    <TabsTrigger value="cli">
      CLI
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add https://shadcn-cssinjs.com/r/breadcrumb.json
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Install the following dependencies:
      </Step>

      ```bash
      pnpm add @stylexjs/stylex
      ```

      <Step>
        Make sure [StyleX is configured](/docs/installation) and the design tokens are
        installed.
      </Step>

      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource name="breadcrumb" title="breadcrumb.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</Tabs>

## Usage [#usage]

```tsx
import {
  Breadcrumb,
  BreadcrumbItem,
  BreadcrumbLink,
  BreadcrumbList,
  BreadcrumbPage,
  BreadcrumbSeparator,
} from "@/components/ui/breadcrumb/breadcrumb";
```

```tsx
<Breadcrumb>
  <BreadcrumbList>
    <BreadcrumbItem>
      <BreadcrumbLink href="/">Home</BreadcrumbLink>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <BreadcrumbPage>Current</BreadcrumbPage>
    </BreadcrumbItem>
  </BreadcrumbList>
</Breadcrumb>
```

## Composition [#composition]

Use the following composition to build a `Breadcrumb`:

```txt
Breadcrumb
└── BreadcrumbList
    ├── BreadcrumbItem
    │   ├── BreadcrumbLink
    │   └── BreadcrumbPage
    ├── BreadcrumbSeparator
    └── BreadcrumbEllipsis
```

## Examples [#examples]



### Basic [#basic]

<ComponentPreview name="breadcrumb-basic">
  <BreadcrumbBasic />
</ComponentPreview>

### Custom separator [#custom-separator]

Pass children to `BreadcrumbSeparator` to use a custom separator.

<ComponentPreview name="breadcrumb-separator">
  <BreadcrumbSeparatorDemo />
</ComponentPreview>

### Dropdown [#dropdown]

Compose with a `DropdownMenu` to show a list of links.

<ComponentPreview name="breadcrumb-dropdown">
  <BreadcrumbDropdown />
</ComponentPreview>

### Collapsed [#collapsed]

Use `BreadcrumbEllipsis` to collapse a long breadcrumb.

<ComponentPreview name="breadcrumb-ellipsis">
  <BreadcrumbEllipsisDemo />
</ComponentPreview>

### Link component [#link-component]

Use the `render` prop to render a custom link component.

<ComponentPreview name="breadcrumb-link">
  <BreadcrumbLinkDemo />
</ComponentPreview>



## RTL [#rtl]

To enable right-to-left support, see the [RTL guide](/docs/rtl).

<ComponentPreview name="breadcrumb-rtl" direction="rtl">
  <BreadcrumbRtl />
</ComponentPreview>

## API Reference [#api-reference]

### Breadcrumb [#breadcrumb]

The `Breadcrumb` component is the root navigation element that wraps all breadcrumb components.

| Prop        | Type     | Default |
| ----------- | -------- | ------- |
| `className` | `string` | -       |

### BreadcrumbList [#breadcrumblist]

The `BreadcrumbList` component displays the ordered list of breadcrumb items.

| Prop        | Type     | Default |
| ----------- | -------- | ------- |
| `className` | `string` | -       |

### BreadcrumbItem [#breadcrumbitem]

The `BreadcrumbItem` component wraps individual breadcrumb items.

| Prop        | Type     | Default |
| ----------- | -------- | ------- |
| `className` | `string` | -       |

### BreadcrumbLink [#breadcrumblink]

The `BreadcrumbLink` component displays a clickable link in the breadcrumb.

| Prop        | Type     | Default |
| ----------- | -------- | ------- |
| `className` | `string` | -       |

### BreadcrumbPage [#breadcrumbpage]

The `BreadcrumbPage` component displays the current page in the breadcrumb (non-clickable).

| Prop        | Type     | Default |
| ----------- | -------- | ------- |
| `className` | `string` | -       |

### BreadcrumbSeparator [#breadcrumbseparator]

The `BreadcrumbSeparator` component displays a separator between breadcrumb items. Pass custom children to override the default separator icon.

| Prop        | Type              | Default |
| ----------- | ----------------- | ------- |
| `children`  | `React.ReactNode` | -       |
| `className` | `string`          | -       |

### BreadcrumbEllipsis [#breadcrumbellipsis]

The `BreadcrumbEllipsis` component displays an ellipsis indicator for collapsed breadcrumb items.

| Prop        | Type     | Default |
| ----------- | -------- | ------- |
| `className` | `string` | -       |
