# Breadcrumb

The path to the current page, in Candor's theme: each parent is a link, the current page is plain text marked `aria-current="page"`, and the whole is a labelled navigation landmark. It shows the trail the app gives it and nothing else; collapsed levels are shown as an ellipsis, never dropped without a sign. Nothing moves.

- Registry name: `breadcrumb` (`@candor/breadcrumb`)
- Tier: Pro. Installing it needs a Pro, Premium or Team licence key: the person runs `npx candor-ui key <key>` themselves; never ask for the key in chat or write it to a file.
- Docs: https://candor.themethodic.com/docs/breadcrumb

## Install

```bash
npx candor-ui add breadcrumb
```

Run `npx candor-ui@latest init` once first (https://candor.themethodic.com/get-started.md). Without the CLI: `npx shadcn@latest add @candor/breadcrumb`.
It brings in: locale, locked, render-prop, tokens, utils.
npm packages: lucide-react@^1.67.0, radix-ui@^1.8.1.

## Example

```tsx
"use client"

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

export default function Example() {
  return (
    <Breadcrumb>
      <BreadcrumbList>
        <BreadcrumbItem>
          <BreadcrumbLink href="#home">Workspace</BreadcrumbLink>
        </BreadcrumbItem>
        <BreadcrumbSeparator />
        <BreadcrumbItem>
          <BreadcrumbEllipsis />
        </BreadcrumbItem>
        <BreadcrumbSeparator />
        <BreadcrumbItem>
          <BreadcrumbLink href="#billing" locked="You need billing access to open this.">
            Billing
          </BreadcrumbLink>
        </BreadcrumbItem>
        <BreadcrumbSeparator />
        <BreadcrumbItem>
          <BreadcrumbPage>Invoices</BreadcrumbPage>
        </BreadcrumbItem>
      </BreadcrumbList>
    </Breadcrumb>
  )
}
```

## <Breadcrumb>

No props.

Also takes the props of `React.ComponentProps<"nav">`.

## <BreadcrumbEllipsis>

No props.

Also takes the props of `React.ComponentProps<"span">`.

## <BreadcrumbItem>

No props.

Also takes the props of `React.ComponentProps<"li">`.

## <BreadcrumbLink>

Props:

- `asChild?: boolean | undefined`: Render the child element (a router link, say) with the breadcrumb's styles instead of an <a>.
- `locked?: string | undefined`: Why this level can't be opened right now. When set, it stays focusable and marked `aria-disabled`, following it does nothing, and the reason is shown on hover and focus and read to screen readers (see `Locked`).

Also takes the props of `React.ComponentProps<"a">`, `RenderProp`.

## <BreadcrumbList>

No props.

Also takes the props of `React.ComponentProps<"ol">`.

## <BreadcrumbPage>

No props.

Also takes the props of `React.ComponentProps<"span">`.

## <BreadcrumbSeparator>

No props.

Also takes the props of `React.ComponentProps<"li">`.

## Strings (`breadcrumb`)

The fixed words, English by default. Override any of them under `breadcrumb` in `<LocaleProvider strings={{ breadcrumb: { … } }}>`; the table is exported as `breadcrumbStrings`.

- `label`: Breadcrumb
- `more`: More

## Motion

- **tint** (tint): A link's colour changes when the pointer is over it, and a ring fades in when it takes keyboard focus. The current page is plain text and never changes.

Set with `--cd-motion-breadcrumb-<moment>-*` in your brand file; the families are in the design reference.

## Rules for using Candor UI

- Components take plain typed data. Never pass model output as HTML or render it as a link; messages are typed blocks.
- A control that can't be used says why: wrap it in `<Locked reason="…">`, don't just disable it.
- Don't show a value you don't have: leave it out (it renders as —) rather than guess. An estimate is labelled as one.
- Nothing is pre-selected in a decision a person makes, and the agent is named from your app's data, never from model output.
- Your app's words go in `LocaleProvider` (fixed strings) and `TermsProvider` (nouns); entity kinds and agent roles in `EntityKindsProvider` and `AgentRolesProvider`.
