@api-components/clipboard-copy
TypeScript icon, indicating that this package has built-in type declarations

3.0.0-preview.1 • Public • Published

Build Status

LogicElements.ClipboardCopy component

Tag: <clipboard-copy>

Installation

Using bower:

bower install --save advanced-rest-client/clipboard-copy

An element that copies a text to clipboard.

Example

<clipboard-copy content="test"></clipboard-copy>
<script>
const elm = document.querySelectior('clipboard-copy');
if(elm.copy()) {
 console.info('Content has been copied to the clipboard');
} else {
 console.error('Content copy error. This browser is ancient!');
}
< /script>

API

Component properties (attributes)

content

  • Type: string A content to be copied to the clipboard. It must be set before calling the copy function.

Component methods

copy

  • Return type: Boolean Execute content copy.

Package Sidebar

Install

npm i @api-components/clipboard-copy

Weekly Downloads

3

Version

3.0.0-preview.1

License

Apache-2.0

Unpacked Size

185 kB

Total Files

17

Last publish

Collaborators

  • carowright
  • jarrodek
  • twoplustwoone
  • lbauret