CopyToClipboard
The CopyToClipboard component renders a compact copy control with tooltip feedback. Use it beside values such as IDs, URLs, and API keys.
Import
Basic usage
The control is not rendered when value is empty. Provide surrounding text so users understand what will be copied.
Common props
These are the props most commonly used with this component. See its exported types in @payloadcms/ui for the complete list.
Prop | Type | Default | Description |
|---|---|---|---|
| | — | Value written to the clipboard. |
| | Localized copy label | Tooltip shown before the value is copied. |
| | Localized copied label | Tooltip shown after a successful copy. |
Was this page helpful?