Socket
Socket
Sign inDemoInstall

@gradeup/copy-text-to-cb

Package Overview
Dependencies
5
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @gradeup/copy-text-to-cb

react component to copy text to clipboard with function to execute after copying.


Version published
Maintainers
5
Install size
150 kB
Created

Readme

Source

copy-text-to-cb

React component to copy text to clipboard on clicking with function to execute after copying.

Installation

npm install --save @gradeup/copy-text-to-cb

Usage

Import the module to your code

import CopyText from '@gradeup/copy-text-to-cb'; // React Component to be used for copying text on click

usage

import CopyText from '@gradeup/copy-text-to-cb';

<CopyText 
    text="Hello copy text" 
    component={props => <button {...props}>Copy</button>}
    cb={console.log}
/>
Params

Folowing are the params to be passed :

optionused forrequireddefault
texttext to be copiedtrue-
componentcomponent on which click is to be activatedfalseprops => <button type="button" {...props}>Copy</button>
cbfunction to execute after copyingfalse() => {}
poppop message to show after copying or notfalsetrue
popStylepop box stylefalseposition: 'absolute', background: '#333', color: '#fff', padding: '3px', align: 'center', fontSize: '12px', transform: 'translateX(-50%)', left: '50%',transition: 'all 0.3s ease'

Change the text and enjoy copying on your website.

You can visit some links for reference:

  • Github Link For Repo
  • Npm Link for the module

Organisation

Gradeup

Keywords

FAQs

Last updated on 13 Feb 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc