<clipboard-copy>
Copies the target to the clipboard as either HTML or plain text.
Attributes
target
- A CSS selector that identifies the wrapper whose content will be copied. If multiple elements match the selector only the contents of the first one will be copied.mode
(optional) - Set to eithertext
(default) orhtml
. If set tohtml
the contents of the target element will be copied as rich text. If set totext
the contents of the target element will be copied as plain text.
Slots
button-text
- Used to provide the text to be displayed in the button part of the component.
CSS parts
clipboard-copy::part(button)
- Targets the<button>
part of the component, to allow styling to be applied.
Example
This is some rich text with bold, italic, and coloured text to be copied to the clipboard.
Code
HTML
JS