Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

CopyToClipboard

The CopyToClipboard component renders a compact copy control with tooltip feedback. Use it beside values such as IDs, URLs, and API keys.

Import

1
import { CopyToClipboard } from '@payloadcms/ui'

Basic usage

Loading component example…

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.

Was this page helpful?

Next

DatePicker