GithubHelp home page GithubHelp logo

react-copy-to-clipboard-ui's Introduction

React Copy To Clipboard UI

A react component to display text with copy to clipboard option

alt text

Installation

Use npm to install

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

Usage

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

react-copy-to-clipboard-ui's People

Contributors

spgandhi avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.