# Thread divider

A rule across the thread with a label in the middle: a day ("Today", "Yesterday", "5 Nov 2026") or a chapter of the conversation ("Drafting", "Review"). Read by screen readers as a separator with that label. Dates wait for the browser's clock and time zone, like every time in Candor, so server and browser render the same thing.

- Registry name: `thread-divider` (`@candor/thread-divider`)
- Tier: Free (MIT). No licence key needed.
- Docs: https://candor.themethodic.com/docs/thread-divider

## Install

```bash
npx candor-ui add thread-divider
```

Run `npx candor-ui@latest init` once first (https://candor.themethodic.com/get-started.md). Without the CLI: `npx shadcn@latest add @candor/thread-divider`.
It brings in: locale, relative-time, utils.

## Example

```tsx
"use client"

import { ThreadDivider } from "@/components/thread-divider"

const daysAgo = (d: number) => new Date(Date.now() - d * 86_400_000)

export default function Example() {
  return (
    <div className="flex max-w-xl flex-col gap-4">
      <ThreadDivider date={daysAgo(9)} />
      <ThreadDivider date={daysAgo(1)} />
      <ThreadDivider date={daysAgo(0)} />
      <ThreadDivider label="Review" />
      <ThreadDivider />
    </div>
  )
}
```

## <ThreadDivider>

Props:

- `date?: Date | string | undefined`: A day to mark, shown as Today, Yesterday or the date in the locale. With neither this nor `label`, a plain rule.
- `label?: string | undefined`: A chapter or any other label; wins over `date`.
- `className?: string | undefined`

## Strings (`threadDivider`)

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

- `today`: Today
- `yesterday`: Yesterday

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