pastel-qr-scan
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Pastel QR Code Scanner & Reader

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:

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.

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.

Package Sidebar

Install

npm i pastel-qr-scan

Weekly Downloads

9

Version

1.0.2

License

MIT

Unpacked Size

3.61 MB

Total Files

9

Last publish

Collaborators

  • ngvtuan