/html5-qrcode-react-example

Example of using mebjas/html5-qrcode in react

Primary LanguageTypeScriptMIT LicenseMIT

html5-qrcode react example

This projects demonstrates usage of mebjas/html5-qrcode library.

Some features of the example:

  • uses latest react 18
  • uses react hooks
  • is written in React.StrictMode

ScannerExample.tsx shows usage of Html5QrcodeScanner.

AdvancedExample.tsx is more robust example. It uses Html5Qrcode.

  • example requests camera permissions on load
  • enables custom camera switching
  • enables to pause and resume code scanning
  • enables to freeze scanning for limited time after catching a code

Live demo

Live demo

Gif example

html5-qrcode-example

Available Scripts

In the project directory, you can run:

yarn start

Runs the demo in the development mode.
Open http://localhost:3000 to view it in the browser.

Learn More

This project was bootstrapped with Create React App.