@svelte-put/copy
TypeScript icon, indicating that this package has built-in type declarations

3.0.2 • Public • Published

@svelte-put/copy

npm.badge bundlephobia.badge docs.badge

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 on:copied="{handleCopied}">Click to copy this</button>

Package Sidebar

Install

npm i @svelte-put/copy

Weekly Downloads

284

Version

3.0.2

License

MIT

Unpacked Size

13.5 kB

Total Files

8

Last publish

Collaborators

  • vnphanquang