copy-lite

import {copyToClipboard} from 'copy-lite'

Usage no npm install needed!

<script type="module">
  import copyLite from 'https://cdn.skypack.dev/copy-lite';
</script>

README

copy-lite

import {copyToClipboard} from 'copy-lite'

API

copyToClipboard(content: string, richHtml: boolean)

Examples

Text

copyToClipboard('This is normal text')

Rich text

copyToClipboard('This text has a <b>bold</b> element and a <a href="https://google.com">link</a>', true)