Skip to content

pastak/react-copy-button-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-copy-button-wrapper

Component Wrapper for Copy to Clipboard Button with React

Usage

% npm install react-copy-button-wrapper

<ReactCopyButtonWrapper text='test'>
  <button>Copy</button>
</ReactCopyButtonWrapper>

Example

Please look at /example directory.

Demo page is here: http://pastak.github.io/react-copy-button-wrapper/example/example.html

How works

Modern Browsers

Firefox, Chrome, Opera, IE9+ works with Selection API and execCommand

Safari

It works with react-zeroclipboard which is relies on zeroclipboard.

It depends on Flash!!!!!!!!!!!!

< IE9

It works with window.clipboardData.setData

Motivation

Clipboard API was comming to modern browsers and clipboard.js is great solution. However Safari and old browsers don't support yet.

Zeroclipboard is solution for all browsers but it's not better because depends on flash...

And some react components for copy buttons ( for example react-copy-to-clipboard react-clipboard ) have only support for modern browsers.

This component's goal is that works with modern browsers and safari and old-IE.

About

Component Wrapper for Copy to Clipboard Button with React

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •