# 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).

<DocsBaseSwitcher base="web" component="breadcrumb" />

<ComponentPreview name="breadcrumb" title="breadcrumb.tsx">
<Component />
</ComponentPreview>

Breadcrumb shows the path from the site root to the current page. It helps users understand where they are and jump back to any ancestor level.

## Installation [#installation]

<CodeTabs>
<TabsList>
<TabsTrigger value="cli">
Command
</TabsTrigger>

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

<TabsContent value="cli">
~~~bash
npx frakment add breadcrumb
~~~
</TabsContent>

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

~~~bash
npm install lucide-react
~~~

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

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

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

## Usage [#usage]

~~~tsx title="breadcrumb.tsx"
import {
  Breadcrumb,
  BreadcrumbItem,
  BreadcrumbLink,
  BreadcrumbList,
  BreadcrumbPage,
  BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
~~~

~~~tsx
<Breadcrumb>
  <BreadcrumbList>
    <BreadcrumbItem><BreadcrumbLink href="/">Home</BreadcrumbLink></BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem><BreadcrumbLink href="/components">Components</BreadcrumbLink></BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem><BreadcrumbPage>Breadcrumb</BreadcrumbPage></BreadcrumbItem>
  </BreadcrumbList>
</Breadcrumb>
~~~

## Composition [#composition]

```text
Breadcrumb
└── BreadcrumbList
    ├── BreadcrumbItem
    └── BreadcrumbSeparator
```

## Examples [#examples]

### Basic [#basic]

<ComponentPreview name="breadcrumb-basic" src="examples/breadcrumb-basic.tsx" title="breadcrumb-basic.tsx">
<a />
</ComponentPreview>

### Custom separator [#custom-separator]

Pass any node as children to replace the chevron.

<ComponentPreview name="breadcrumb-separator" src="examples/breadcrumb-separator.tsx" title="breadcrumb-separator.tsx">
<d />
</ComponentPreview>

### With router link [#with-router-link]

Pass `as` on `BreadcrumbLink` to render a router component.

<ComponentPreview name="breadcrumb-link" src="examples/breadcrumb-link.tsx" title="breadcrumb-link.tsx">
<g />
</ComponentPreview>

### Ellipsis [#ellipsis]

Collapse the middle of a long path with `BreadcrumbEllipsis`.

<ComponentPreview name="breadcrumb-ellipsis" src="examples/breadcrumb-ellipsis.tsx" title="breadcrumb-ellipsis.tsx">
<k />
</ComponentPreview>

### With dropdown [#with-dropdown]

Open a `DropdownMenu` from an intermediate level to show siblings.

<ComponentPreview name="breadcrumb-dropdown" src="examples/breadcrumb-dropdown.tsx" title="breadcrumb-dropdown.tsx">
<p />
</ComponentPreview>

## In Context [#in-context]

### Docs path [#docs-path]

<ComponentPreview name="breadcrumb-docs-path" src="examples/breadcrumb-docs-path.tsx" title="breadcrumb-docs-path.tsx">
<x />
</ComponentPreview>

### In a page header [#in-a-page-header]

<ComponentPreview name="breadcrumb-page-header" src="examples/breadcrumb-page-header.tsx" title="breadcrumb-page-header.tsx">
<u />
</ComponentPreview>

## API Reference [#api-reference]

### BreadcrumbLink [#breadcrumblink]

<PropsTable rows={[{"name":"href","type":"string","description":"Destination URL."},{"name":"as","type":"React.ElementType","description":"Renders a different root element or component. Defaults to a."}]} />

### BreadcrumbPage [#breadcrumbpage]

<PropsTable rows={[{"name":"aria-current","type":"string","default":"page","description":"Marks the active page."}]} />

## Accessibility [#accessibility]

- Wrapper is `<nav aria-label="breadcrumb">`, giving a named landmark.
- Current page uses `aria-current="page"` and is not focusable.
- Separators are `role="presentation"` so they are skipped by screen readers.

## Best Practices [#best-practices]

- **Last item is a page, not a link.** Use `BreadcrumbPage`, not `BreadcrumbLink`.
- **Skip the root if obvious.** If the logo links to home, do not repeat "Home".
- **Keep segments short.** "Docs / Button", not "Documentation / Button component".
- **Do not use breadcrumbs for wizard steps.** Use a Stepper instead.