# Breadcrumb

Breadcrumb navigation trail



<ComponentPreview base="opentui" name="breadcrumb-demo" />

Installation [#installation]

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

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

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @termcn/opentui-breadcrumb
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Copy and paste the following code into your project.
      </Step>

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

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

Usage [#usage]

```tsx
import { Breadcrumb } from "@/components/ui/breadcrumb";
```

```tsx
<Breadcrumb
  items={[
    { key: "home", label: "Home", onSelect: () => {} },
    { key: "docs", label: "Docs" },
  ]}
  activeKey="docs"
/>
```

API Reference [#api-reference]

Breadcrumb [#breadcrumb]

| Prop        | Type               | Default    |
| ----------- | ------------------ | ---------- |
| `items`     | `BreadcrumbItem[]` | `required` |
| `separator` | `string`           | `"›"`      |
| `activeKey` | `string`           | -          |

BreadcrumbItem [#breadcrumbitem]

| Prop       | Type         | Default    |
| ---------- | ------------ | ---------- |
| `label`    | `string`     | `required` |
| `key`      | `string`     | `required` |
| `onSelect` | `() => void` | -          |
