Clipboard
Copies a value on click and says so with a kit toast. Works outside a secure context too, and makes a plain element reachable from the keyboard.
Part of @tectra-ng/utils (npm install @tectra-ng/utils, also included in tectra-ng).
Basic
[txCopy] on a button: the value goes to the clipboard and a "Copied to clipboard" toast appears in the tectra locale.
Plain element
On a plain element the directive adds role="button" and a tab stop, so Enter and Space copy too. Tab to an id and press Enter.
ORD-1042 | Northwind Studio |
ORD-1043 | Blue Harbor |
ORD-1044 | Oakline Partners |
Messages
Your own toast text, or [copyMessage]="false" and a check mark from the copied output instead.
Service
TxClipboard.copy() from code — here the filters of a report as JSON — with the same toasts.