Installations
npm install @martenhc/react-qr-scanner
Developer Guide
BETA
Typescript
Yes
Module System
CommonJS
Node Version
20.11.0
NPM Version
10.2.4
Score
65.2
Supply Chain
79.6
Quality
77.4
Maintenance
100
Vulnerability
98.9
License
Releases
Unable to fetch releases
Download Statistics
Total Downloads
448
Last Day
1
Last Week
1
Last Month
1
Last Year
448
Bundle Size
384.29 kB
Minified
100.31 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.1.2
Package Id
@martenhc/react-qr-scanner@0.1.2
Unpacked Size
4.60 MB
Size
1.01 MB
File Count
37
NPM Version
10.2.4
Node Version
20.11.0
Publised On
25 Feb 2024
Total Downloads
Cumulative downloads
Total Downloads
448
Last day
0%
1
Compared to previous day
Last week
0%
1
Compared to previous week
Last month
-80%
1
Compared to previous month
Last year
0%
448
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
25
@babel/preset-env@babel/preset-react@babel/preset-typescript@rollup/plugin-commonjs@rollup/plugin-node-resolve@rollup/plugin-typescript@storybook/addon-actions@storybook/addon-essentials@storybook/addon-interactions@storybook/addon-links@storybook/react@storybook/react-webpack5@types/node@types/react@types/react-domreactreact-domrolluprollup-plugin-copyrollup-plugin-dtsrollup-plugin-peer-deps-externalrollup-plugin-terserstorybooktslibtypescript
Versions
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
1import {QrScanner} from '@yudiel/react-qr-scanner'; 2 3const App = () => { 4 return ( 5 <QrScanner 6 onDecode={(result) => console.log(result)} 7 onError={(error) => console.log(error?.message)} 8 /> 9 ); 10}
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 |
No vulnerabilities found.
No security vulnerabilities found.