All Projects → JodusNodus → React Qr Reader

JodusNodus / React Qr Reader

Licence: mit
React component for reading QR codes from webcam.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Qr Reader

Instascan
HTML5 QR code scanner using your webcam
Stars: ✭ 2,657 (+271.09%)
Mutual labels:  qr-code, webcam, qrcode
Vue Qrcode Reader
A set of Vue.js components for detecting and decoding QR codes.
Stars: ✭ 1,240 (+73.18%)
Mutual labels:  qr-code, qrcode, webrtc
python
Build Python extension with Dynamsoft Barcode Reader.
Stars: ✭ 35 (-95.11%)
Mutual labels:  qrcode, qr-code
quagga2-reader-qr
Quagga2 sample external reader for QR codes
Stars: ✭ 20 (-97.21%)
Mutual labels:  qrcode, qr-code
qrcode
A flutter plugin for scanning QR codes. Use AVCaptureSession in iOS and zxing in Android.
Stars: ✭ 69 (-90.36%)
Mutual labels:  qrcode, qr-code
paper-store
Cold store small files on paper as QR codes -- PGP keys, Bitcoin keys, Tox keys or any other small files in general.
Stars: ✭ 28 (-96.09%)
Mutual labels:  qrcode, qr-code
vk-qr
VK QR Code generator library
Stars: ✭ 43 (-93.99%)
Mutual labels:  qrcode, qr-code
simple-login-qrcode-webcam-php
🐱‍💻 Just simple login mechanism using QR Code Scanner with Webcam in PHP
Stars: ✭ 66 (-90.78%)
Mutual labels:  qrcode, webcam
QR-secret-sharing
🔒 Create QR codes to secret-share a message. Ideal for cryptocurrency wallet recovery keys and passwords.
Stars: ✭ 94 (-86.87%)
Mutual labels:  qrcode, qr-code
ZATCA
An unofficial package maintained by Salla to help developers to implement ZATCA (Fatoora) QR code easily which required for e-invoicing
Stars: ✭ 77 (-89.25%)
Mutual labels:  qrcode, qr-code
covidpass
Scan your vaccination, test and recovery certificates in QR code representation and save them to your Apple Wallet
Stars: ✭ 137 (-80.87%)
Mutual labels:  qrcode, qr-code
Php Qrcode
A QR Code generator for PHP7.4+
Stars: ✭ 685 (-4.33%)
Mutual labels:  qr-code, qrcode
WeChatQRCode
⛄ 基于OpenCV开源的微信二维码引擎移植的Android扫码识别库
Stars: ✭ 250 (-65.08%)
Mutual labels:  qrcode, qr-code
QRCodeFX
Simple tool to generate/read QR Code and export it.
Stars: ✭ 31 (-95.67%)
Mutual labels:  qrcode, qr-code
nova-qrcode-field
A Laravel Nova field to generate QR Code
Stars: ✭ 28 (-96.09%)
Mutual labels:  qrcode, qr-code
QRCode-Generator-PHP-Class
🚀 QRCode PHP class (library). QR Code Generator using vCard 4.0 and the Google Chart API
Stars: ✭ 91 (-87.29%)
Mutual labels:  qrcode, qr-code
QrCodeGenerator
QR Code Generator for .NET
Stars: ✭ 66 (-90.78%)
Mutual labels:  qrcode, qr-code
Qr Code
Web Component for generating QR codes
Stars: ✭ 425 (-40.64%)
Mutual labels:  qr-code, qrcode
qr-pirate
crawl QR-codes from search engines and look for bitcoin private keys
Stars: ✭ 58 (-91.9%)
Mutual labels:  qrcode, qr-code
kanban-board-app
Kanban style task management board app
Stars: ✭ 118 (-83.52%)
Mutual labels:  qrcode, qr-code

npm version

Introduction

A React component for reading QR codes from the webcam. It uses the WebRTC standards for reading webcam data and jsQR is used for detecting QR codes in that data. To optimise the speed and experience, a web-worker is used to offload the heavy QR code algorithm on a separate process. The web worker is inlined and loaded on creation of the component.

Demo

https://jodusnodus.github.io/react-qr-reader

Known Issues

  • Server side rendering won't work so only require the component when rendering in a browser environment.
  • Due to browser implementations the camera can only be accessed over https or localhost.
  • In Firefox a prompt will be shown to the user asking which camera to use, so facingMode will not affect it.
  • On IOS 11 it is only supported on Safari and not on Chrome or Firefox due to Apple making the API not available to 3rd party browsers.

Install

npm install --save react-qr-reader

Example

import React, { Component } from 'react'
import QrReader from 'react-qr-reader'

class Test extends Component {
  state = {
    result: 'No result'
  }

  handleScan = data => {
    if (data) {
      this.setState({
        result: data
      })
    }
  }
  handleError = err => {
    console.error(err)
  }
  render() {
    return (
      <div>
        <QrReader
          delay={300}
          onError={this.handleError}
          onScan={this.handleScan}
          style={{ width: '100%' }}
        />
        <p>{this.state.result}</p>
      </div>
    )
  }
}

Props

Events

Prop Argument Description
onScan result Scan event handler. Called every scan with the decoded value or null if no QR code was found.
onError Error Called when an error occurs.
onLoad object Called when the component is ready for use. Object properties are mirrorVideo: boolean, streamLabel: string
onImageLoad img onLoad event Called when the image in legacyMode is loaded.

Options

Prop Type Default Description
delay number or false 500 The delay between scans in milliseconds. To disable the interval pass in false.
facingMode user or environment environment Specify which camera should be used (if available).
resolution number 600 The resolution of the video (or image in legacyMode). Larger resolution will increase the accuracy but it will also slow down the processing time.
style a valid React style none Styling for the container element. Warning The preview will always keep its 1:1 aspect ratio.
className string none ClassName for the container element.
showViewFinder boolean true Show or hide the build in view finder. See demo
constraints object null Use custom camera constraints that the override default behavior. MediaTrackConstraints
legacyMode boolean false If the device does not allow camera access (e.g. IOS Browsers, Safari) you can enable legacyMode to allow the user to take a picture (On a mobile device) or use an existing one. To trigger the image dialog just call the method openImageDialog from the parent component. Warning You must call the method from a user action (eg. click event on some element).

Dev

Install dependencies

npm install

Build

npm run build

Demo

npm run storybook

Linting

npm run lint

Tested platforms

  • Chrome macOs & Android
  • Firefox macOs & Android
  • Safari macOs & IOS

License

The MIT License (MIT)

Copyright (c) 2018 Thomas Billiet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].