# 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, tokens, utils.
npm packages: @base-ui/react@^1.9.0, lucide-react@^1.67.0.

## Example

```tsx
"use client"

import {
  Breadcrumb,
  BreadcrumbEllipsis,
  BreadcrumbItem,
  BreadcrumbLink,
  BreadcrumbList,
  BreadcrumbPage,
  BreadcrumbSeparator,
} from "@/components/candor/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>

A "…" standing in for the levels of a `Breadcrumb` that are collapsed, with a label for screen readers.

No props.

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

## <BreadcrumbItem>

One level of a `BreadcrumbList`, holding a `BreadcrumbLink` or the current `BreadcrumbPage`.

No props.

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

## <BreadcrumbLink>

A link to an earlier level in a `Breadcrumb`.

Props:

- `render?: useRender.RenderProp | undefined`: Draws this element (a router link, say) with the breadcrumb's styles instead of an <a>: `render={<Link href="/runs" />}`. The element keeps its own children unless the link is given some.
- `locked?: string | null | 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`). `null` or left out: unlocked.

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

## <BreadcrumbList>

The ordered list inside a `Breadcrumb`, holding its items and separators.

No props.

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

## <BreadcrumbPage>

The current level in a `Breadcrumb`: not a link, and marked as the current page for screen readers.

No props.

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

## <BreadcrumbSeparator>

The mark between two levels of a `Breadcrumb`, hidden from screen readers; a chevron unless given children.

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`: its fixed strings in `strings`, its nouns in `nouns`; entity kinds and agent roles in `EntityKindsProvider` and `AgentRolesProvider`.
