# react-copy-to-clipboard-ui

> A react component with copy to clipboard functionality

Latest version **1.0.2** (published 2019-11-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-copy-to-clipboard-ui
pnpm add react-copy-to-clipboard-ui
yarn add react-copy-to-clipboard-ui
bun add react-copy-to-clipboard-ui
```

## 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-11-03 |
| First published | 2019-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 17.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Shreyans Gandhi |
| Maintainers | spgandhi |
| Keywords | react-component, react, copy-to-clipboard |

## Links

- npm: https://www.npmjs.com/package/react-copy-to-clipboard-ui
- Repository: https://github.com/spgandhi/react-copy-to-clipboard-ui
- Homepage: https://github.com/spgandhi/react-copy-to-clipboard-ui#readme
- Issues: https://github.com/spgandhi/react-copy-to-clipboard-ui/issues
- npm.io page: https://npm.io/package/react-copy-to-clipboard-ui

## Dependencies (5)

- [jest](https://npm.io/package/jest.md) ^24.9.0
- [jest-enzyme](https://npm.io/package/jest-enzyme.md) ^7.1.2
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.6.1
- [enzyme-adapter-react-16](https://npm.io/package/enzyme-adapter-react-16.md) ^1.15.1
- [jest-environment-enzyme](https://npm.io/package/jest-environment-enzyme.md) ^7.1.2

## 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-11-03
- 1.0.1 — 2019-11-03
- 1.0.0 — 2019-10-29

## README

# React Copy To Clipboard UI

A react component to display text with copy to clipboard option

![alt text](https://i.imgur.com/CxGWM6q.png)


## Installation

Use npm to install

```bash
npm i -S react-copy-to-clipboard-ui
```

## Usage

```python
import ReactCopyToClipboardUI from 'react-copy-to-clipboard-ui';

function MyComponent = () => (
    <ReactCopyToClipboardUI>This is my text</ReactCopyToClipboardUI>
);

```

## Props


| Props | Type  | Default Value | Description  |
|--|-|-|---|
| children | React component or string | ```this is copyable text``` |The text to display
| copyText | string | ```null``` |The text that should be copied to clipboard when action button is clicked. Note: if null, then the value of the children prop will be copied.  |
| btnLabel | string | ```copy``` | The action button label to show when the mouse hovers over the component
| onCopyBtnLabel | string | ```copied``` | The action button label to show after copy action takes place. This label will stay for ``` onCopyBtnLabelDuration``` value
| containerStyle | object | | Style of the container
| aciveContainerStyle | object ||Style of the container when the mouse hovers over the component
|textStyle | object| | Style of the displayed text
|activeTextStyle | object | |style of the displayed text when the mouse hovers over the component
|btnStyle|object||style of the action button
|onCopy|func|null|callback function when action button is clicked. Receives the copied text as the parameter|
|onMouseEnter|func|null|callback function when the mouse enters the component
|onMouseLeave | func |null | callback function when the mouse leaves the component
## License
[MIT](https://choosealicense.com/licenses/mit/)

---
_Source: https://npm.io/package/react-copy-to-clipboard-ui · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
