---
layout: ~/layouts/MdxDocLayout.astro
title: "Breadcrumbs"
description: "A navigation component that shows the current page's location within a navigational hierarchy."
sourceFile: "components/breadcrumbs"
---

import ComponentExample from "~/components/docs/ComponentExample.astro";
import ComponentSection from "~/components/docs/ComponentSection.astro";
import CodeBlock from "~/components/docs/CodeBlock.astro";
import PropsTable from "~/components/docs/PropsTable.astro";
import Heading from "~/components/docs/Heading.astro";
import {
  BreadcrumbsDemo,
  BreadcrumbsWithIconsDemo,
  BreadcrumbsWithClipboardDemo,
  BreadcrumbsLoadingDemo,
  BreadcrumbsRootDemo,
} from "~/components/demos/BreadcrumbsDemo";

<ComponentSection>
  <ComponentExample
    code={`<Breadcrumbs>
  <Breadcrumbs.Link icon={<HouseIcon size={16} />} href="/">
    Home
  </Breadcrumbs.Link>
  <Breadcrumbs.Separator />
  <Breadcrumbs.Link href="/docs">Projects</Breadcrumbs.Link>
  <Breadcrumbs.Separator />
  <Breadcrumbs.Current>Current Project</Breadcrumbs.Current>
</Breadcrumbs>`}
  >
    <BreadcrumbsWithIconsDemo client:visible />
  </ComponentExample>
</ComponentSection>

<ComponentSection>
  <Heading level={2}>Installation</Heading>
  <CodeBlock
    code={`import { Breadcrumbs } from "@cloudflare/kumo";`}
    lang="tsx"
  />
</ComponentSection>

<ComponentSection>
  <Heading level={2}>Usage</Heading>
  <CodeBlock code={`import { Breadcrumbs } from "@cloudflare/kumo";

export default function Example() {
  return (
    <Breadcrumbs>
      <Breadcrumbs.Link href="/">Home</Breadcrumbs.Link>
      <Breadcrumbs.Separator />
      <Breadcrumbs.Link href="/docs">Docs</Breadcrumbs.Link>
      <Breadcrumbs.Separator />
      <Breadcrumbs.Current>Breadcrumbs</Breadcrumbs.Current>
    </Breadcrumbs>
  );
}`} lang="tsx" />
</ComponentSection>

<ComponentSection>
  <Heading level={2}>Examples</Heading>

  <Heading level={3}>Basic</Heading>
  <ComponentExample code={`<Breadcrumbs>
  <Breadcrumbs.Link href="#">Home</Breadcrumbs.Link>
  <Breadcrumbs.Separator />
  <Breadcrumbs.Link href="/docs">Docs</Breadcrumbs.Link>
  <Breadcrumbs.Separator />
  <Breadcrumbs.Current>Breadcrumbs</Breadcrumbs.Current>
</Breadcrumbs>`}>
    <BreadcrumbsDemo client:visible />
  </ComponentExample>
</ComponentSection>

<ComponentSection>
  <Heading level={3}>Loading</Heading>
  <ComponentExample
    code={`<Breadcrumbs>
  <Breadcrumbs.Link href="#" icon={<HouseIcon size={16} />}>
    Home
  </Breadcrumbs.Link>
  <Breadcrumbs.Separator />
  <Breadcrumbs.Link href="/docs">Docs</Breadcrumbs.Link>
  <Breadcrumbs.Separator />
  <Breadcrumbs.Current loading></Breadcrumbs.Current>
</Breadcrumbs>`}
  >
    <BreadcrumbsLoadingDemo client:visible />
  </ComponentExample>
</ComponentSection>

<ComponentSection>
  <Heading level={3}>Root</Heading>
  <ComponentExample
    code={`<Breadcrumbs>
  <Breadcrumbs.Current icon={<HouseIcon size={16} />}>
    Worker Analytics
  </Breadcrumbs.Current>
</Breadcrumbs>`}
  >
    <BreadcrumbsRootDemo client:visible />
  </ComponentExample>
</ComponentSection>

<ComponentSection>
  <Heading level={3}>Clipboard</Heading>
  <ComponentExample
    code={`<Breadcrumbs>
  <Breadcrumbs.Link href="#">Home</Breadcrumbs.Link>
  <Breadcrumbs.Separator />
  <Breadcrumbs.Current>Breadcrumbs</Breadcrumbs.Current>
  <Breadcrumbs.Clipboard text="#" />
</Breadcrumbs>`}
  >
    <BreadcrumbsWithClipboardDemo client:visible />
  </ComponentExample>
</ComponentSection>

<ComponentSection>
  <Heading level={2}>API Reference</Heading>

<Heading level={3}>Breadcrumbs</Heading>
<PropsTable component="Breadcrumbs" />

<Heading level={3}>Breadcrumbs.Link</Heading>
<PropsTable component="Breadcrumbs.Link" />

<Heading level={3}>Breadcrumbs.Current</Heading>
<PropsTable component="Breadcrumbs.Current" />

<Heading level={3}>Breadcrumbs.Separator</Heading>
<PropsTable component="Breadcrumbs.Separator" />

  <Heading level={3}>Breadcrumbs.Clipboard</Heading>
  <PropsTable component="Breadcrumbs.Clipboard" />
</ComponentSection>
