svelte-copy-url-button

1.0.6 • Public • Published

svelte-copy-url-button

Simple Svelte based button that copies the current url.

version

Installation

Using npm

Sapper or Other Svelte Bundler

For Sapper you need to install the package as a dev module to so it gets compiled. If you install it as a runtime dependency you will 500 errors on the server side. This is explained here.

$ npm i -D svelte-copy-url-button

PureJS

$ npm i --save svelte-copy-url-button

Usage

Basic usage from svelte looks like this:

<script>
import SvelteCopyUrlButton from 'svelte-copy-url-button';
// If url is not passed it will copy the url of the current page
let url = "https://svelte-copy-url-button.netlify.app/"
</script>

<SvelteCopyUrlButton
  class="customClassName"
  size="14"
  defaultText="Copy url"
  copiedText="Copied!"
  icon="{false}"
  timeout="1000"
  url="{url}"
/>

Demo

Package Sidebar

Install

npm i svelte-copy-url-button

Weekly Downloads

2

Version

1.0.6

License

MIT

Unpacked Size

42 kB

Total Files

7

Last publish

Collaborators

  • kostadinterziev