Pastel QR Code Scanner & Reader
Pastel QR Code Scanner & Reader is a component built to scan PSL QR codes using a webcam.
You can install this library via NPM or YARN.
npm i pastel-qr-scan
yarn add pastel-qr-scan
After reading and performing the previous steps, you should be able to import the library and use it like in this example:
import React, { useState } from 'react';
import { QrReader } from 'pastel-qr-scan';
const Test = (props) => {
const [data, setData] = useState('No result');
return (
<>
<QrScan
onResult={(result) => {
if (result) {
setData(result?.text);
}
}}
/>
<p>{data}</p>
</>
);
};
The Pastel QR Code Scanner & Reader
component has the following props:
Properties | Types | Default Value | Description |
---|---|---|---|
onResult | function |
none | Scan event handler |
videoWidth | string |
100% |
The width for the video element |
videoHeight | string |
100% |
The height for the video element |
className | string |
none | ClassName for the container element. |
Please, open an issue following one of the issues templates. We will do our best to fix them.
Distributed under the MIT license. See LICENSE for more information.