Coder Social home page Coder Social logo

shortboxedinc / react-qr-scanner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yudielcurbelo/react-qr-scanner

0.0 0.0 0.0 29.72 MB

A library to scan QR Codes in react.

Home Page: https://yudielcurbelo.github.io/react-qr-scanner/

License: MIT License

JavaScript 10.92% TypeScript 89.08%

react-qr-scanner's Introduction

Features

  • Scan Qr Codes using a smartphone camera or webcam.

Demo

Checkout the Demo.

Install

yarn add @yudiel/react-qr-scanner

npm install @yudiel/react-qr-scanner

Usage

import {QrScanner} from '@yudiel/react-qr-scanner';

const App = () => {
  return (
      <QrScanner
          onDecode={(result) => console.log(result)}
          onError={(error) => console.log(error?.message)}
      />
  );
}

Supported Formats

1D product 1D industrial 2D
UPC-A Code 39 QR Code
EAN-8 Code 128 Data Matrix
EAN-13 RSS-14 Aztec
PDF 417

Limitations

  • Due to browser implementations the camera can only be accessed over https or localhost.
  • Server side rendering won't work so only require the component when rendering in a browser environment.

API

Properties Types Default Value Description
constraints MediaTrackConstraints { facingMode: 'environment' } Specify which camera should be used (if available).
containerStyle object none Style object for the container element.
videoStyle object none Style object for the video element.
scanDelay number 500 The scan period for the QR hook.
videoId string videoId The Id for the video element.
onResult function none Scan event handler for result object.
onDecode function none Scan event handler for decode value.
onError function none Scan event handler for error object.
ViewFinder component none ViewFinder component to rendering as overlay in the video element
hideCount boolean true Hide the scanned count as overlay in the video element
stopDecoding boolean false Stop the decoding process

react-qr-scanner's People

Contributors

considerate avatar idindrakusuma avatar raghupviyer avatar yudielcurbelo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.