Skip to content

Commit 747be91

Browse files
authored
docs: add copy and paste documentation for blocks (#15987)
- Outlines expected behavior for copy/paste functionality - Adds warning about how this will replace block(s) content
1 parent 99dcac1 commit 747be91

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/fields/blocks.mdx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,42 @@ import {
133133
} from '@payloadcms/richtext-lexical/client'
134134
```
135135

136+
## Copying and Pasting Blocks
137+
138+
The Admin Panel includes built-in copy and paste support for both individual block rows and entire Blocks fields. This is available through the row action menu (the `...` button on each block) and from the field-level action menu in the field header.
139+
140+
### Row-level vs. Field-level
141+
142+
- **Row copy/paste** — copies a single block and lets you paste it into any position within any compatible Blocks field
143+
- **Field copy/paste** — copies all blocks in the field at once and pastes them as the full contents of a target field, replacing whatever was there
144+
145+
### How it differs from Duplicate
146+
147+
The **Duplicate** action creates an immediate in-place copy of a block, inserted directly below the original — always within the same field on the same document.
148+
149+
**Copy/paste** is designed for moving data across fields or documents:
150+
151+
- Copy a block on `Page A`, open `Page B`, and paste it into that page's blocks field
152+
- Copy a block from one Blocks field and paste it into a different Blocks field on the same document
153+
154+
### How it works
155+
156+
Copied data is written to `localStorage` under the key `_payloadClipboard`. This means:
157+
158+
- The clipboard persists across browser tabs (same origin)
159+
- It is not shared between different Payload origins
160+
161+
When pasting, Payload validates that the copied block type exists in the target field's `blocks` config. If the schemas are incompatible, the paste action will not be available. All block and nested array IDs are automatically regenerated on paste to prevent duplicate key errors.
162+
163+
<Banner type="warning">
164+
**"Paste Fields" replaces all blocks, even when a single row is on the clipboard.**
165+
166+
If you have copied a single block row and then use **Paste Fields** (the field-level paste action in the field header), all existing blocks in the target field will be replaced with just that one copied row.
167+
168+
To add a copied row to a field that already has content, use **Paste Row** instead: add a new empty block first, then use the row-level **Paste Row** action on that new row to replace it with the copied data.
169+
170+
</Banner>
171+
136172
## Blocks Items
137173

138174
### Config Options

0 commit comments

Comments
 (0)