Skip to Content

React Barcode Scanner

React components and hooks for scanning barcodes with a browser camera, built on the Barcode Detection API. Use the native BarcodeDetector, or add a ZBar or ZXing polyfill.

When should I use it?

Use it for camera scanning, barcode format configuration, torch control and multiple-scanner workflows in React or Next.js. When the browser lacks the Barcode Detection API, import either the ZBar or ZXing polyfill.

Key capabilities

  • Composable scanner hooks with direct state access and control
  • Native BarcodeDetector support
  • Included ZBar polyfill with optional ZXing polyfill support
  • Isolated scanner state through BarcodeScannerProvider

Start here

Project and support

The project is MIT licensed. Visit GitHub  for source code and issues, or view the published react-barcode-scanner package on npm.

Last updated on