# react-qr-reader_multiformatreader

> A React Component for reading QR codes and Barcodes from the webcam

Latest version **1.0.5** (published 2024-03-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-qr-reader_multiformatreader
pnpm add react-qr-reader_multiformatreader
yarn add react-qr-reader_multiformatreader
bun add react-qr-reader_multiformatreader
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2024-03-19 |
| First published | 2023-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | thomas billiet |
| Maintainers | danielkramarczyk |
| Keywords | react, qr, qrcode, qrreader, barcode |

## Links

- npm: https://www.npmjs.com/package/react-qr-reader_multiformatreader
- Repository: https://github.com/ivansazdovski/react-qr-reader_multiFormatReader
- Homepage: https://github.com/ivansazdovski/react-qr-reader_multiFormatReader#readme
- Issues: https://github.com/ivansazdovski/react-qr-reader_multiFormatReader/issues
- npm.io page: https://npm.io/package/react-qr-reader_multiformatreader

## Dependencies (3)

- [rollup](https://npm.io/package/rollup.md) ^2.67.2
- [@zxing/browser](https://npm.io/package/@zxing/browser.md) 0.1.4
- [@zxing/library](https://npm.io/package/@zxing/library.md) ^0.20.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2024-03-19
- 1.0.4 — 2023-08-08
- 1.0.3 — 2023-08-04
- 1.0.2 — 2023-07-28
- 1.0.1 — 2023-07-27
- 1.0.0 — 2023-07-27

## README

# React QR Reader MultiFormatReader

**Attention!!!!**

This repository and library is fork from here https://github.com/JodusNodus/react-qr-reader

## Table of contents

- [Use Case](#use-case)
- [Compatibility](#compatibility)
- [Example Usage](#example-usage)
- [QrReader API](#component-api)
- [Maintainers](#maintainers)
- [License](#license)

## Use Case

You need a component for Scanning QR codes and Barcodes from a web browser based app.
This project uses the zxing library with all its supported formats. (See https://github.com/zxing/zxing)

## 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`.

## Example Usage

After reading and performing the previous steps, you should be able to import the library and use it like in this example:

```javascript
import React, { useState } from 'react';
import { QrReader } from 'react-qr-reader_multiformatreader';

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:

| Properties          | Types                                                                                           | Default Value                   | Description                                              |
| ------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------- | -------------------------------------------------------- |
| constraints         | [MediaTrackConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints) | `{ facingMode: 'environment' }` | Specify which camera should be used (if available).      |
| onResult            | `function`                                                                                      | none                            | Scan event handler                                       |
| videoId             | `string`                                                                                        | `video`                         | The ID for the video element                             |
| scanDelay           | `number`                                                                                        | `500`                           | The scan period for the QR hook                          |
| ViewFinder          | component                                                                                       | none                            | ViewFinder component to rendering over the video element |
| className           | string                                                                                          | none                            | ClassName for the container element.                     |
| containerStyle      | object                                                                                          | none                            | Style object for the container element.                  |
| videoContainerStyle | object                                                                                          | none                            | Style object for the video container element.            |
| videoStyle          | object                                                                                          | none                            | Style object for the video element.                      |

## Maintainers

- Current Maintainers [@ivansazdovski](https://github.com/ivansazdovski)

- Original Author [@JodusNodus](https://github.com/JodusNodus)

## Work on repository

Node.js <= v16.
yarn install
yarn run storybook
check it on phone on same network with https:

- generate certificate: openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt
- run storybook: yarn start-storybook -p 6006 --https --ssl-cert ./localhost.crt --ssl-key ./localhost.key

## 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.

---
_Source: https://npm.io/package/react-qr-reader_multiformatreader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
