0.2.6 • Published 4 years ago

clip-it v0.2.6

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

CLIP IT

A totally easy way for modern browsers to put something into clipboard.

build npm codecov license

Try it Out

Demo by Codepen

Installation

$ npm i --save clip-it

Usage

HTML

<button>Copy as Text</button>
<button>Copy as HTML</button>

JavaScript

import clipIt from 'clip-it'

const $btnCopyText = document.querySelector('button')
const $btnCopyHTML = document.querySelector('button')

$btnCopyText.onclick = e => clipIt('Hello World'))

$btnCopyHTML.onclick = e => clipIt('<span style="color: red;">Hello world!</span>', {
  contentType: 'text/html'
}))

ATTENTION

  • The clip-it API must be triggered in the same callstack with a trusted event.
  • Some browsers only supports to copy plain text. (e.g. iOS Safari)
0.2.6

4 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago