# CopyButton

Copies a text to the clipboard and says whether it worked.

Group: Tools. Code: `components/software/tools.tsx`. From the old system: CopyLinkButton in @id-identity-as/ui. Live: https://design.id-hub.dk/software/copy-button

```tsx
import { CopyButton } from '@/components/software/tools';

<CopyButton value={url} copiedLabel="Kopieret" failedLabel="Kunne ikke kopiere">Kopiér link</CopyButton>
```

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| value (required) | `string` |  | The text that is copied, such as a link. |
| copiedLabel (required) | `string` |  | What the button says once the text is copied. |
| failedLabel (required) | `string` |  | What the button says when the browser refuses. |
| children (required) | `ReactNode` |  | The label of the button. |

Do:
- Say what is copied in the label: "Kopiér link".
- Show the text that is copied nearby, so it can also be selected by hand.

Do not:
- Do not copy without a press.
- Do not hide a failure. A copy that did not happen says so.

Accessibility:
- The outcome is announced politely to a screen reader.
- It is the outline Button, so the keyboard works as on any button.

Tokens it uses:
- color.button.outline.stroke
- color.button.outline.text
- radius.sm
- type.button.md

---

Not drawn in Figma. Kasper decided on 20 November 2026 that internal software gets this set now, built only from the tokens. The look is ours until Peter draws it, and every open choice is a question in docs/SPOERGSMAAL-TIL-PETER.md. The public site, campaigns and brand surfaces use only the components drawn in Figma.

The rules for this set and all 33 components: https://design.id-hub.dk/software.md. Token values: https://design.id-hub.dk/tokens.md.

Index of everything, as text: https://design.id-hub.dk/llms.txt. Never invent a colour, a size, a component or a product fact: if it is not here, it does not exist yet.
