# Copy field

A value a person copies somewhere else (a callback URL, a scope list). The whole field is the copy target; it says "Copied" only once the clipboard took the value, and its tick (or the cross of a refused write) appears then, never while the write is still pending.

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

## Install

```bash
npx candor-ui add copy-field
```

Run `npx candor-ui@latest init` once first (https://candor.themethodic.com/get-started.md). Without the CLI: `npx shadcn@latest add @candor/copy-field`.
It brings in: locale, use-copy, utils.
npm packages: lucide-react@^1.67.0.

## Example

```tsx
"use client"

import { CopyField } from "@/components/copy-field"

export default function Example() {
  return <CopyField className="max-w-sm" label="Request id" value="req_01JC8Z4M2V7Q" />
}
```

## <CopyField>

Props:

- `label: string`: What the value is, shown above it.
- `value: string`: The text that is shown and copied.
- `className?: string | undefined`

## Strings (`copyField`)

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

- `copy`: Copy
- `copied`: Copied
- `failed`: Couldn’t copy

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