3.0.0-beta-1 • Published 2 years ago

react-qr-reader v3.0.0-beta-1

Weekly downloads
23,601
License
MIT
Repository
github
Last release
2 years ago

React QR Reader npm version License: MIT Known Vulnerabilities

:rocket: React QR Reader component. Check out the demo.

Table of contents

Use Case

You need a component for Scanning QR codes from a web browser based app.

Compatibility

This component has been tested in the following browsers:

  • Chrome Mac OS & Android
  • Firefox Mac OS & Android
  • Safari Mac OS & IOS

Since this library does internal use of hooks you need React >= 16.8.0.

Installation

You can install this library via NPM or YARN.

NPM

npm i react-qr-reader

YARN

yarn add react-qr-reader

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 'react-qr-reader';

const Test = (props) => {
  const [data, setData] = useState('No result');

  return (
    <>
      <QrReader
        onResult={(result, error) => {
          if (!!result) {
            setData(result?.text);
          }

          if (!!error) {
            console.info(error);
          }
        }}
        style={{ width: '100%' }}
      />
      <p>{data}</p>
    </>
  );
};

Component API

The QrReader component has the following props:

PropertiesTypesDefault ValueDescription
constraintsMediaTrackConstraints{ facingMode: 'user' }Specify which camera should be used (if available).
onResultfunctionnoneScan event handler
videoIdstringvideoThe ID for the video element
scanDelaynumber500The scan period for the QR hook
ViewFindercomponentnoneViewFinder component to rendering over the video element
classNamestringnoneClassName for the container element.
containerStyleobjectnoneStyle object for the container element.
videoContainerStyleobjectnoneStyle object for the video container element.
videoStyleobjectnoneStyle object for the video element.

Browser Support

If you need to support older browsers, checkout this guide in how to make it compatible with legacy ones

Issues

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

Contributing

If you want to contribute to this project see contributing for more information.

License

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

zwap-qrcode-frontendbms-le-scanning-modulesaxiuss-systemgold-claim@infinitebrahmanuniverse/nolb-react-qdemotestpublish@everything-registry/sub-chunk-2605@polkadot-cloud/recipes-testcaseark-ui@jimengio/ipeca-ui@jimengio/mescal-ui@jimengio/qrcode-popup@parity/ui@parity/qr-signer@ripplemaker/ripples-ui@polkadot/ui-qrreact-jsonschema-form-uireact-jsonschema-form-ui2poc-components-qr-code@keystonehq/sdk@material-did/qr@matec/tap-web-payment-sdkqr-reader-bankrebel-walletsmweb-frontendspectrum-lightsuiteygh-player@youkuohao/qrdemoreportelabreport-publishreport-publish-ap@polkadot/react-qrsamaelnpmreportcsriskfix@polkadot-cloud/recipes@polkadot-ui/recipes@qorebase/app-runtime@subwallet/extension-koni-ui@soul-wallet/extension-koni-ui@susytech/qr-signer@susy-js/qr-signerkanban_scannereth-componentselabnext_editorelabnext_reportgatsby-theme-bch-walletamarpanchal-report-publishfood-trace-xmu@anon-aadhaar/reactfullstack-gatsby-theme-bch-walletfullstack-gatsby-theme-bch-wallet-v1@arconnect/keystone-sdk@ahmadevnts/design-systemfindingpi-react-components@axia-js/react-qr@axiasolar-js/react-qrmlkpsymph-rootmst-workflowdapparatus@cvbb/sdk@cybercongress/dapp-wallet@cybercongress/dapp-wallet2nc-payments-ui@bemit/flood-admindebot-web-embeddingbancor-walletbitsoft-c3@digigov/ui-dilosi-integrationkamand-webcowry-payment-sdkbch-wallet-plugin-boilerplate@burner-wallet/modern-ui@burner-wallet/ui@burner-wallet/classic-uigatsby-ipfs-web-walletiota-react-componentscross-swapisobar.ot-app-coreobiman-assetsop-wallet@ist-group/skolid-client-components
3.0.0-beta-1

2 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.2

5 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.2.9

8 years ago

0.2.8

8 years ago

0.2.7

8 years ago

0.2.6

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago