This package is part of the @svelte-put family. For contributing guideline and more, refer to its readme.
See the dedicated documentation page here.
<script lang="ts">
import { copy, type CopyDetail } from '@svelte-put/copy';
function handleCopied(e: CustomEvent<CopyDetail>) {
console.log('Text copied:', e.detail.text);
}
</script>
<button type="button" use:copy oncopied={handleCopied}>Click to copy this</button>