2.0.0 • Published 7 years ago

@axetroy/react-clipboard v2.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

react-clipboard

clipboard wrapper component for react

Online demo

Install

yarn add react          # requirement
yarn add clipboard      # requirement
yarn add @axetroy/react-clipboard

Usage

import { Component } from "react";
import ReactClipboard from "@axetroy/react-clipboard";

class App extends Component {
  render() {
    return (
      <div>
        <ReactClipboard
          value={"you will copy me!"}
          onSuccess={() => {
            console.log("copy success");
          }}
          onError={() => {
            console.error("copy error");
          }}
        >
          <input type="button" value="Click me & copy that." />
        </ReactClipboard>
      </div>
    );
  }
}

Props

  • value: string

    any string you want to copy

  • onSuccess: function

    success callback

  • onError: function

    error callback

Run the Demo

git clone https://github.com/axetroy/react-clipboard.git
yarn
yarn start

License

The MIT License

2.0.0

7 years ago

1.0.0

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago