Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@yudiel/react-qr-scanner

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yudiel/react-qr-scanner

A library to scan qr codes in react.

  • 1.1.6-beta.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
30K
increased by5.18%
Maintainers
1
Weekly downloads
 
Created
Source

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 product1D industrial2D
UPC-ACode 39QR Code
EAN-8Code 128Data Matrix
EAN-13RSS-14Aztec
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

PropertiesTypesDefault ValueDescription
constraintsMediaTrackConstraints{ facingMode: 'environment' }Specify which camera should be used (if available).
containerStyleobjectnoneStyle object for the container element.
videoStyleobjectnoneStyle object for the video element.
scanDelaynumber500The scan period for the QR hook.
videoIdstringvideoIdThe Id for the video element.
onResultfunctionnoneScan event handler for result object.
onDecodefunctionnoneScan event handler for decode value.
onErrorfunctionnoneScan event handler for error object.
ViewFindercomponentnoneViewFinder component to rendering as overlay in the video element
hideCountbooleantrueHide the scanned count as overlay in the video element

FAQs

Package last updated on 22 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc