npm

svelte-code-copy
TypeScript icon, indicating that this package has built-in type declarations

1.0.36 • Public • Published

svelte-code-copy

npm-version npm-license npm-download-month npm-min-size ci.yml website

❏ Just wrap it with this

Installation

npm i svelte-code-copy

Usage

pre is optional. <CodeCopy> copies the innerText of <code>

<script>
  import { CodeCopy } from 'svelte-code-copy'
</script>

<CodeCopy>
  <pre>
    <code>
      <!-- Your code block -->
    </code>
  </pre>
</CodeCopy>

Props

full details

Prop Type Default
onCopy function undefined
size number 18
background string transparent
color string whitesmoke
success string green
error string red
top string 0.5rem
right string 0.5rem
border string none
padding string 0.25rem
borderRadius string 0.25rem
margin string 0
effect string pop
duration number 150

License

MIT

Package Sidebar

Install

npm i svelte-code-copy

Weekly Downloads

4,137

Version

1.0.36

License

MIT

Unpacked Size

9.74 kB

Total Files

7

Last publish

Collaborators

  • jill64