@svelte-put/copy
v4.0.0
Published
Svelte action & utilities for copying text to clipboard
Downloads
2,858
Maintainers
Readme
@svelte-put/copy
Svelte action use:copy
and utility for copying text to clipboard
svelte-put
This package is part of the @svelte-put family. For contributing guideline and more, refer to its readme.
Usage & Documentation
See the dedicated documentation page here.
Quick Start
<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>