3.0.0 • Published 16 days ago

zmp-qrcode v3.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
16 days ago

ZMP QR Code

React component for generating QR codes that match Zalo Mini App looks and feels.

Installation

npm i zmp-qrcode

Usage

import { QRCode } from 'zmp-qrcode'

<QRCode value="https://www.npmjs.com/package/zmp-qrcode" />

Preview

API Documentation

QRCode

Props

NameDescriptionDefault
value*string-
sizenumber128

Ref

You can export the QR code as a base64 image using ref. Here is an example:

export const Base64 = (args) => {
  const ref = useRef<QRCodeInstance>()
  const [src, setSrc] = useState('');

  return <div>
    <QRCode ref={el => el ? setTimeout(() => setSrc(el.getBase64()), 1000) : el} {...args} rounded />
    <img src={src} alt="" />
  </div>
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

3.0.0

16 days ago

2.3.0

3 years ago

2.2.0

3 years ago

2.4.0

3 years ago

2.1.0

3 years ago

1.5.0

3 years ago

2.0.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago