Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svelte-copy-to-clipboard

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-copy-to-clipboard

Copy to clipboard component for Svelte

  • 0.1.1
  • npm
  • Socket score

Version published
Weekly downloads
507
decreased by-21.76%
Maintainers
1
Weekly downloads
 
Created
Source

Svelte Copy to Clipboard

A flexible copy to clipboard component for Svelte

Installation

npm i svelte-copy-to-clipboard
// OR
yarn add svelte-copy-to-clipboard

Local demo:

git clone https://github.com/henriquecaraujo/svelte-copy-to-clipboard.git
cd svelte-copy-to-clipboard/example
yarn && yarn start

Examples

<script>
  import CopyToClipboard from "svelte-copy-to-clipboard";
  let exampleText = 'Copy me!';

  const handleSuccessfullyCopied = () => {
      alert('successfully copied to clipboard!');
  }

  const handleFailedCopy = () => {
      alert('failed to copy :(');
  }
</script>

<CopyToClipboard text={exampleText} onCopy={handleSuccessfullyCopied} onFail={handleFailedCopy} let:copy>
    <button on:click={copy}>An element to trigger the copy</button>
</CopyToClipboard>

Properties

Component props:

PropTypeDescription
textstringValue to copy
onCopyfuncCall when text's copied
onFailfuncCall when copy fails

NPM Statistics

Download stats for this NPM package

NPM

License

Svelte Infinite Scroll is open source software licensed as MIT.

Keywords

FAQs

Package last updated on 31 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc