Copy to Clipboard renders a button — or a read-only input paired with a button — that copies a preset text string to the visitor's clipboard on click. Use it for API keys, coupon codes, install commands, referral links, or any text visitors need to copy exactly.
How to add
Open the block inserter, switch to the Axiom Blocks category, and click Copy to Clipboard. The block drops in as a button-only layout with placeholder text.
Content
Display Mode controls the layout:
| Mode | Output |
|---|---|
| Button Only | A single copy button, no input visible |
| Input + Button | A read-only text input showing the text alongside the copy button |
Input + Button is useful when you want visitors to see exactly what they're copying before they click. The input is always readonly — visitors cannot edit it.
- Text to Copy — the string sent to the clipboard. Any value: a URL, a command, a coupon code, a license key.
- Placeholder — visible only in Input + Button mode. Shown in the input when Text to Copy is empty.
- Button Label — text on the button before copying. Default
Copy. - Copied Label — text shown briefly after a successful copy. Default
Copied!. The button reverts after 2 seconds.
Icon
Show Icon toggles the clipboard icon on the button. When enabled, Icon Position places it Left or Right of the label. The icon swaps to a checkmark when the copy succeeds and reverts when the button resets.
Style
Alignment positions the button or input row within the block: Left (default), Center, or Right. It's a per-device control — set it once for desktop and override it on tablet or mobile using the device switcher at the top of the control.
Button Style:
| Style | Appearance |
|---|---|
| Filled | Solid background with contrasting text |
| Outline | Transparent background with a border, text in the button color |
The sidebar at a glance
The block sidebar is split into two tabs. Settings is what the block does; Styles is how it looks, organised by the parts you can see.
| Tab | Section | Covers |
|---|---|---|
| Settings | Content | Display mode, text to copy, placeholder, labels |
| Settings | Icon | Show icon, icon position |
| Settings | Style | Alignment, button style |
| Settings | Advanced | Visibility, Position, anchor, CSS class |
| Styles | Button | The copy button itself |
| Styles | Spacing | Padding and margin on the outer wrapper |
Styling
| Part | Rows |
|---|---|
| Button | Button Color, Text Color, Copied background, Typography, Border, Radius, Shadow |
- Button Color — the fill in Filled mode, or the border and text color in Outline mode. Default
#7c3aed. - Text Color — the label color in Filled mode. Default
#ffffff. - Copied background — the background the button flashes on a successful copy. Default
#00a32a. In Outline mode the border switches to this color too. - Typography — family, size, weight, line height, letter spacing, transform, and decoration for the label.
- Border — per-side width, style, and color.
- Radius — per-corner rounding, up to 40 px.
- Shadow — box shadow on the button.
The block supports Wide and Full alignment from the toolbar and an HTML anchor.
HTML output
Button-only mode:
Input + button mode wraps both in .axiom-blocks-copy-to-clipboard__input-row, with a screen-reader-text label bound to the readonly <input class="axiom-blocks-copy-to-clipboard__input">. The button carries the same data-* attributes in either mode.
CSS custom properties
| Property | Controls |
|---|---|
--ab-ctc-bg | Button background (Filled mode) |
--ab-ctc-color | Button label color |
--ab-ctc-bs / --ab-ctc-bc | Border style and color |
--ab-ctc-bw-* | Per-side border width (top, right, bottom, left) |
--ab-ctc-radius-* | Per-corner radius (tl, tr, br, bl); --ab-ctc-radius carries a legacy single value |
--ab-ctc-shadow | Button box shadow |