Files
Sean Zubrickas 4884195d71 docs: add UI component library (#18093)
Adds the first release of @payloadcms/ui component documentation,
focused on common, visually useful components and working Payload v3
examples.
- Adds component guides, usage guidance, props, and accessibility notes.
- Adds an overview and curated component inventory under Features → UI
Components.



*_v4 as a fast follow once this gets approved_
2026-09-03 10:30:26 -07:00

32 lines
1.2 KiB
Plaintext

---
title: CopyToClipboard
label: CopyToClipboard
order: 80
desc: Copy a string to the clipboard with Payload's CopyToClipboard component.
keywords: ui, component, clipboard, copy, tooltip
---
The `CopyToClipboard` component renders a compact copy control with tooltip feedback. Use it beside values such as IDs, URLs, and API keys.
## Import
```tsx
import { CopyToClipboard } from '@payloadcms/ui'
```
## Basic usage
<ComponentPreview component="CopyToClipboard" example="basic" />
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` | `string` | — | Value written to the clipboard. |
| `defaultMessage` | `string` | Localized copy label | Tooltip shown before the value is copied. |
| `successMessage` | `string` | Localized copied label | Tooltip shown after a successful copy. |