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

2.0.0 • 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>

Changelog

buy vnphanquang a coffee

Install

npm i @svelte-put/copy

DownloadsWeekly Downloads

99

Version

2.0.0

License

MIT

Unpacked Size

43.1 kB

Total Files

15

Last publish

Collaborators

  • vnphanquang