Copies text to the clipboard.

Basic Usage

<span adf-clipboard="translate_key" [clipboard-notification]="notify message">
    text to copy
</span>

<button adf-clipboard="translate_key" target="ref" [clipboard-notification]="notify message">
    Copy
</button>

Class members

Properties

NameTypeDefault valueDescription
messagestringTranslation key or message for snackbar notification.
placeholderstringTranslation key or message for the tooltip.
targetHTMLInputElement|HTMLTextAreaElementReference to the HTML element containing the text to copy.

Details

Clicking on the decorated element will copy the text content of that element (or the element specified in the target property) to the clipboard.

Use the parameter to adf-clipboard to specify a tooltip message that will be shown when the user hovers the mouse over the element. You can also provide a snackbar message in the clipboard-notification property, which will appear when the copying is complete.

See also

© 2023 Alfresco Software, Inc. All Rights Reserved.