Internal ID software / Tools
CopyButton
Copies a text to the clipboard and says whether it worked.
Not drawn in Figma: built only from the tokens, for internal ID software. In code: components/software/tools.tsx. From the old system: CopyLinkButton in @id-identity-as/ui.
Props
| 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