# @gradeup/copy-text-to-cb

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

Latest version **1.0.2** (published 2019-02-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install @gradeup/copy-text-to-cb
pnpm add @gradeup/copy-text-to-cb
yarn add @gradeup/copy-text-to-cb
bun add @gradeup/copy-text-to-cb
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-02-13 |
| First published | 2019-02-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 39 |
| Author | Aman Agarwal |
| Maintainers | niksrc, pc099, taranjeet, typeofnull, ustatleen |
| Keywords | react, copy-text, clipboard, text-clipboard |

## Links

- npm: https://www.npmjs.com/package/@gradeup/copy-text-to-cb
- Repository: https://github.com/AmanAgarwal041/copy-text-to-cb
- Homepage: https://github.com/AmanAgarwal041/copy-text-to-cb#readme
- Issues: https://github.com/AmanAgarwal041/copy-text-to-cb/issues
- npm.io page: https://npm.io/package/@gradeup/copy-text-to-cb

## Dependencies (1)

- [prop-types](https://npm.io/package/prop-types.md) ^15.7.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2019-02-13
- 1.0.1 — 2019-02-13
- 1.0.0 — 2019-02-12

## README

# copy-text-to-cb

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

## Installation
``` shell
npm install --save @gradeup/copy-text-to-cb
```

## Usage

### Import the module to your code
``` javascript
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 :

| option              | used for | required | default |
| ------------------- |----------| ---------| ------- |
| `text`              | text to be copied | true | - |
| `component`         | component on which click is to be activated | false | `props => <button type="button" {...props}>Copy</button>` |
| cb | function to execute after copying | false | `() => {}` |
| pop | pop message to show after copying or not | false | true
| popStyle | pop box style | false | `position: '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.`

## Links

You can visit some links for reference:

* [Github Link For Repo](https://github.com/AmanAgarwal041/copy-text-to-cb)
* [Npm Link for the module](https://www.npmjs.com/package/@gradeup/copy-text-to-cb)

## Organisation
[![Gradeup](https://gs-post-images.grdp.co/2018/10/gradeup-rocket-img1539852366965-76.png-rs-high-webp.png)](https://gradeup.co)

---
_Source: https://npm.io/package/@gradeup/copy-text-to-cb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
