npm.io
0.2.0 • Published 4 years ago

qwik-copy-text

Licence
MIT
Version
0.2.0
Deps
2
Size
88 kB
Vulns
0
Weekly
0
Stars
1

⌗ qwik-copy-text

A react text copy component to easily copy html as rich text format in clipboard.

npm version

code style: prettier

Features

  • Hassle free html to rich formatted text
  • Lightweight
  • Easy to use
  • fully customizable style

Install

Via package managers:

$ npm i qwik-copy-text
$ yarn add qwik-copy-text

Example Usage

import QwikCopy from 'qwik-copy-text'
// custom style !optional
 const style = {
    display: 'flex',
    justifyContent: 'center',
    alignItems: 'center',
    width: '20px',
    height: '20px',
    padding: '10px',
    background: '#5784f5',
    color: '#fff',
    fontSize: '20px',
    border: 'none',
    outline: 'none',
    borderRadius: '10px',
    cursor: 'pointer',
  }


 <QwikCopy 
 isDisabled={false}
 styles={style} 
 htmlContent={`<h1> Hello from qwikcopy! </h1>`} 
 />

Props

Prop Type Requirement Description
isDisabled boolean required hide/show the component true or false
htmlContent string required html to rich text
styles object optional object of React style

Contributing

Feel free to submit any issues or pull request

Keywords