r-copy-image-clipboard
v1.0.1
Published
Lightweight copy png and jpg images to clipboard
Downloads
2
Maintainers
Readme
Created with :heart: by Luan Eduardo da Costa | [email protected]
:page_with_curl: About
This library helps you to copy JPG and PNG images to clipboard easily. Can be used with React, Vue, Angular and other web frameworks.
:white_check_mark: Installation
- Using yarn
yarn add copy-image-clipboard
- Using npm
npm i copy-image-clipboard
:zap: Usage
// Import the copy function
import copyImg from 'copy-image-clipboard'
// Use the image src attribute here
copyImg('imageSrc')
See the demo
folder for a more detailed example with React.
:globe_with_meridians: Compatibility
- Created and tested using Chrome 84.0
This project uses the asynchronous Clipboard API and the Fetch API. Use the links below to see the browser compatibility:
:blue_book: License
This project is under the MIT license. See the LICENSE for more information.