Developers · Gutenberg

Clipboard Copy block for WordPress

Display a copyable code, coupon, or text with a one-click copy button.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Display a copyable code, coupon, or text with a one-click copy button.

Inspector panels on this block: Content, Layout, Card Colors. Those titles come from index.js, not from a shared template.

Behavior controls: “Card Style” options: Card (bordered), Inline, Minimal; “Layout — Size” options: Small, Medium, Large; “Layout — Alignment” options: Left, Center, Right.

Where to find it

Gutenberg inserter → Developers → search “Clipboard Copy” (block name `blockenberg/clipboard-copy` in block.json). Style it in the sidebar after insert.

How to use Clipboard Copy block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Clipboard Copy”, insert it. Category: Developers.
  3. Configure inspector controls that exist on this block. Open Content. Set “Text to Copy”, “Button Label”, “Copied State Label”, “Description text (optional)”.
  4. Check the published page. The view script reads HTML data attributes: data-text. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Text to CopyText field in the inspector. block.json default: SAVE20. Saved as `textToCopy`.
Button LabelText field in the inspector. block.json default: Copy Code. Saved as `label`.
Copied State LabelText field in the inspector. block.json default: Copied! ✓. Saved as `copiedLabel`.
Description text (optional)Multiline text field in the inspector. Saved as `description`.
Show code display areaOn/off toggle in the inspector. On by default. Saved as `showCode`.
Show copy icon on buttonOn/off toggle in the inspector. On by default. Saved as `iconEnabled`.
Card StyleSelect control; the chosen value is saved on the block. Options: Card (bordered); Inline; Minimal. block.json default: card. Saved as `style`.
Layout — SizeSelect control; the chosen value is saved on the block. Options: Small; Medium; Large. block.json default: md. Saved as `size`.
Layout — AlignmentSelect control; the chosen value is saved on the block. Options: Left; Center; Right. block.json default: left. Saved as `alignment`.
Border RadiusNumeric range control in the inspector. Range 0–30. block.json default: 8. Saved as `borderRadius`.
Toast Duration (ms)Numeric range control in the inspector. Range 500–5000. block.json default: 2000. Saved as `toastDuration`.
Card BackgroundColor control in the inspector. block.json default: #f9fafb. Saved as `bgColor`.
Border ColorColor control in the inspector. block.json default: #e5e7eb. Saved as `borderColor`.
Code Area BGColor control in the inspector. block.json default: #f3f4f6. Saved as `codeBg`.
Code Text ColorColor control in the inspector. block.json default: #111827. Saved as `codeColor`.
Button BGColor control in the inspector. block.json default: #111827. Saved as `btnBg`.
Button TextColor control in the inspector. block.json default: #ffffff. Saved as `btnColor`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Clipboard Copy block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Clipboard Copy”. It sits under Developers. After insert, open Content and set “Text to Copy”, “Button Label”, “Copied State Label”, “Description text (optional)”.

What makes Clipboard Copy different from other Blockenberg blocks?

Display a copyable code, coupon, or text with a one-click copy button. Inspector labels on this block include “Text to Copy”, “Button Label”, “Copied State Label”, “Description text (optional)”.

Is the Clipboard Copy Gutenberg block free?

Yes. Clipboard Copy ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Clipboard Copy to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Content, Layout, Card Colors).

Related developers blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Clipboard Copy from the Gutenberg inserter.

Get Blockenberg