Skip to content

copyButton

copyButton(label, copiedLabel): BasicExtension

Defined in: extensions/copyButton/index.ts:33

Extension that adds a copy button to the editor. Probably best used with a read-only editor. You must also import styles from prism-code-editor/copy-button.css.

By default, the copy button is only shown when the editor is hovered. To always show it, change the default opacity with the following CSS:

button.pce-copy {
opacity: 1; // or a lower value for a semi-transparent button
}

string = "Copy"

aria-label for the button. Defaults to "Copy".

string = "Copied!"

Temporary aria-label for the button after it has been clicked. Defaults to "Copied!".

BasicExtension