1.0.2 • Published 10 days ago

pastel-qr-scan v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
10 days ago

Docs License Language


Pastel QR Code Scanner & Reader is a component built to scan PSL QR codes using a webcam.

Installation

You can install this library via NPM or YARN.

NPM

npm i pastel-qr-scan

YARN

yarn add pastel-qr-scan

Example Usage

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>
    </>
  );
};

Component API

The Pastel QR Code Scanner & Reader component has the following props:

PropertiesTypesDefault ValueDescription
onResultfunctionnoneScan event handler
videoWidthstring100%The width for the video element
videoHeightstring100%The height for the video element
classNamestringnoneClassName for the container element.

Issues

Please, open an issue following one of the issues templates. We will do our best to fix them.

License

Distributed under the MIT license. See LICENSE for more information.

1.0.2

10 days ago

1.0.1

13 days ago

1.0.0

13 days ago