How to Build a React Native Barcode Scanner

Published

Last updated

Categories Developers

In short:

  • In 2026, the easiest way to build a React Native barcode scanner is to use an AI coding agent plus barcode scanning Agent Skills.
  • Barcode scanning Agent Skills published by a recognized barcode scanning vendor autonomously integrate production-ready barcode scanning into your app.
  • Barcode scanning Agent Skills eliminate the need to hunt through documentation to identify the right product or go through multiple fix-and-try loops.
  • If you’re not using an AI coding assistant, to build a React Native barcode scanner you must manually choose the right SDK, add the supported symbologies for your use case, configure the appropriate scanning features, customize the user interface, and add error handlers.

In 2026, the easiest way to build a React Native barcode scanner with optimal performance is to combine an AI coding assistant with barcode scanning Agent Skills published by a recognized vendor of barcode scanner SDKs. You get the optimal solution for your use case without lengthy evaluation or customization — it just works within a few prompts.

This blog explains how to build an RN barcode scanner using your AI coding assistant and Scandit Agent Skills. We’ve also included alternative instructions on how to manually integrate barcode scanning, criteria for choosing the best barcode scanner SDK, and a comparison between Scandit and popular alternative barcode scanning libraries.

How do I use AI to build a barcode scanner for React Native?

To create a barcode scanner in React Native using AI, combine barcode scanning Agent Skills with an AI coding assistant. Once code is complete, test your new features and performance under real-world conditions.

A word of warning: an AI coding agent integrating barcode scanning without domain-specific Agent Skills is likely to generate inaccurate code, unoptimized features, and broken or outdated functionality. Barcode scanning is specialized, and without domain knowledge both agents and humans struggle to integrate it properly.

Scandit Agent Skills are based on the Agent Skills Open Standard. They bring 15 years of barcode, label, and ID scanning expertise directly into any AI coding agent — grounded in our knowledge of how Scandit APIs are deployed across thousands of customer integrations. In just a few prompts, the skills autonomously select the appropriate product and framework, customize workflows and UI, and generate production-ready integration code.

Here’s how you can use your AI coding assistant and Scandit’s Agent Skills to add production-ready code right at the first prompt.

1. Add production-ready barcode scanning code to your project

  1. Install Scandit Agent Skills into your AI coding agent.

    Claude Code
    Run these commands:
    /plugin marketplace add scandit/skills
    /plugin install scandit-sdk@scandit-plugins
    Codex
    Run these commands:
    codex plugin marketplace add scandit/skills
    codex plugin add scandit-sdk@scandit-plugins
    Cursor
    Click here to install Scandit Agent Skills.

    GitHub Copilot
    Run these commands:
    copilot plugin marketplace add scandit/skills
    copilot plugin install scandit-sdk@scandit-plugins
    Any other AI coding agent
    Run this command:
    npx skills add https://github.com/scandit/skills 
  2. In your AI coding agent, describe your use case in plain language (e.g., "scan barcodes in a warehouse picking app on React Native"), providing as much detail as possible. Photos are good, too, such as pictures of the barcodes on the items you want to scan. The Agent Skill will ask for more information if necessary.
  3. The data-capture-sdk product-picker skill recommends the appropriate Scandit product and framework combination (e.g., SparkScan, BarcodeCapture, MatrixScan AR, MatrixScan Count, Smart Label Capture, etc.).
  4. The matching product-and-framework skill (e.g., sparkscan-rn) autonomously integrates the appropriate code into your project.
  5. If needed, you can use additional prompts to customize workflows, the user interface, data manipulation, and error handling, and to integrate with backend systems.
  6. As always, you should iterate development by reviewing the generated code and testing against production workflows. If changes are required, describe what you want, and the Agent Skill will automatically adjust the code.

If the automatic pickup in step 2 doesn’t work, call the skill explicitly in your prompt (this example uses SparkScan):

/sparkscan-rn use the skill to help me integrate the barcode scanner in my application

2. Test barcode scanning performance in React Native

The best way to test barcode scanning performance is to run your app under real-world conditions.

Whether you use Scandit or another barcode scanning library, here are several ways to test the performance of barcode scanning:

  • Determine whether there is clear guidance, feedback, and helpful hints to foster a smooth workflow rather than a confused, error-prone activity.
  • Try scanning barcodes in different orientations, such as upside down and sideways, and flip the phone upside down to see how the scanner performs.
  • Can you scan barcodes experiencing reflections and glare?
  • Can you scan barcodes at a distance? Are you able to zoom in if needed?
  • Scanning environments can be loud, and frontline workers often wear headphones – will they notice feedback?

For more background and example test cases, read this developer guide on how to measure barcode scanning performance. You can also use our barcodes sample sheet for quick evaluation.

START BARCODE SCANNING IN REACT NATIVE

Add production-ready barcode scanning fast with Scandit Agent Skills

How do I build an RN barcode scanner manually?

To build a React Native barcode scanner manually, first choose the appropriate SDK, then configure barcode symbology support, customize the UI, and test scanning under real-world conditions.

Your best option for balancing customization with development velocity is to use a pre-built barcode scanning component such as Scandit SparkScan. Pre-built components solve many integration challenges for you and reduce timelines, while still allowing for customization.

SparkScan gives you:

  • AI scanning engine that reduces unwanted scans by up to 100% and has a 0% false positive rate for all major barcodes.
  • High-speed scanning for any situation, including data-dense codes and tiny, torn, damaged, curved, and shiny barcodes.
  • Rapid decoding of barcodes even at long range, in low light, or at extreme angles.
  • An optimized user experience, including a shutter button and camera preview that floats on top of any React Native app.
  • Easily customize colors, sizes, and positions of UI elements to fit your app’s existing UI.

The scanning interface comprises a small camera preview window and a large, movable, semi-transparent trigger button that users can drag to their preferred position. When not in use, the preview button disappears, and the trigger button collapses to free up screen real estate.

The fastest way to see if SparkScan will work for you is to run our React Native List Building sample on your desktop or development device. This sample provides a dummy app to scan into, along with a basic scanning interface that includes a capture button and a camera preview.

When run, the sample application looks similar to this:

User interfaces for SparkScan ListBuildingSample for JavaScript showing scanning and results screens
You can deploy SparkScan using the Scandit Agent Skills instructions above. Otherwise, follow the manual steps below.

The prerequisites are:

1. Add the Scandit Data Capture SDK license key to your project

To run the application, you must add the Scandit Data Capture SDK license key to the project.

  1. Open /app/CaptureContext.ts and replace '-- ENTER YOUR SCANDIT LICENSE KEY HERE --' with your license key.

2. Start the Metro Server

You will need to start Metro, the JavaScript bundler that ships with React Native.

To start Metro, open a terminal and run the following command from the root of your React Native project:

# Using npm
npm start

# Using Yarn
yarn start

3. Run the sample app

To test that your license key works and the app runs, build and deploy the application in your Android Emulator or iOS Simulator.

  1. Open a new terminal and run the following command from the root of your RN project:

For Android

# Using npm
npm run android

# Using Yarn
yarn android

For iOS

# using npm
npm run ios

# OR using Yarn
yarn ios

Once running, follow these steps to capture barcodes using your device’s camera:

User interfaces for SparkScan ListBuildingSample for JavaScript showing scanning and results screens with guidance about how to us
4. Change supported symbologies

The symbologies your app supports are configured through SparkScanSettings. The sample app is already configured to support multiple 1D symbologies, such as EAN-13/UPC-12/UPC-A, Code 128, and Interleaved 2 of 5 (ITF).

To change this to the symbologies for your use case:

  1. Open /app/ScanPage.tsx and navigate to the setupScanning() function.
  2. Modify the call to enableSymbologies() as follows:
    sparkScanSettings.enableSymbologies([
        Symbology.EAN13UPCA,
        Symbology.EAN8,
        Symbology.UPCE,
        Symbology.Code39,
        Symbology.Code128,
        Symbology.InterleavedTwoOfFive,
        Symbology.QR,
    ]);

Here, we’ve added support for QR codes.

5. Customize the user interface

The SparkScan built-in user interface includes the camera preview and scanning UI elements. These guide the user through the scanning process.

You can customize many aspects of the default SparkScan UI and UX to suit your needs and use cases. These customizations include the colors of all items (i.e., icons, buttons, toolbar), trigger button icon, size of the preview window, and more.

The graphic below shows three different examples of how colors, positions, and sizes can be customized to fit different apps. If you’re integrating using Scandit Agent Skills, customization can be done using prompts (e.g. for the first example below, something like, “use a fixed trigger button, round and placed bottom right of the screen, in the Scandit teal”)

The following steps explain how to change different UI elements in the sample app.

  1. Open /app/ScanPage.tsx
  2. Navigate to where SparkScanView is declared:
    <SparkScanView
        style={styles.container}
        context={dataCaptureContext}
        sparkScan={sparkScanMode.current}
        sparkScanViewSettings={new SparkScanViewSettings()}
        
        ref={view => {
            if (view) {
                view.feedbackDelegate = sparkScanFeedbackDelegate;
            }
        
        sparkScanViewRef.current = view;
    }}>

3. To change the trigger button's background color and its animation (the pulsing effect shown when the scanner is active), add the following lines. Here, hex values are used to specify different shades of blue.

view.triggerButtonExpandedColor = Color.fromHex("#123768");
view.triggerButtonAnimationColor = Color.fromHex("#59D3DE");

4. To change the toolbar background color, add:

view.toolbarBackgroundColor = Color.fromHex("#01AAA7");

5. To change the size of the camera preview, navigate to where SparkScanViewSettings is declared:

sparkScanViewSettings={new SparkScanViewSettings()}

6. Add this line to change the camera preview from its default smaller size to a larger window:

sparkScanViewSettings.defaultMiniPreviewSize = SparkScanMiniPreviewSize.Expanded;

7. Update the scandit-react-native-datacapture-barcode import to include:

{
...
SparkScanMiniPreviewSize,
} from 'scandit-react-native-datacapture-barcode';

6. Add error feedback

To show an error message when scanning specific barcodes, such as those already added to an existing list, you can customize SparkScan’s error feedback prompt.

The following steps explain how to add an error message to the sample app when the user scans a specific barcode number.

SparkScan-based app showing error feedback when scanning a barcode on an orange juice container

  1. Open /app/ScanPage.tsx and navigate to the isValidBarcode() function.
  2. Change the return statement from this:
    return barcode.data != null && barcode.data !== '123456789';
    to use a barcode number you have. For example:
    return barcode.data != null && barcode.data !== '0059749979610';
  3. Navigate to the sparkScanFeedbackDelegate() function. Change the error feedback definition from this:
    const sparkScanFeedbackDelegate = useMemo(() => {
        const errorFeedback = new SparkScanBarcodeErrorFeedback(
          'Wrong barcode',
          60,
          Color.fromHex('#FF0000'),
          new Brush(Color.fromHex('#FF0000'), Color.fromHex('#FF0000'), 1),
          null,
        );
        
        const successFeedback = new SparkScanBarcodeSuccessFeedback();
    }
    to set a different error message and colors like this:
    const sparkScanFeedbackDelegate = useMemo(() => {
        const errorFeedback = new SparkScanBarcodeErrorFeedback(
          'Barcode is incorrect.',
          60,
          Color.fromHex('#FF0000'),
          new Brush(Color.fromHex('#00FFFF'), Color.fromHex('#FFFFFF'), 1),
          null,
        );
     
       const successFeedback = new SparkScanBarcodeSuccessFeedback(); 
    }

The parameters for SparkScanBarcodeErrorFeedback() are:

  • message: The error message to display when a wrong barcode is captured.
  • resumeCapturingDelay: The time interval after which to resume the capture process, in milliseconds.
  • visualFeedbackColor: The color to flash the screen upon scanning the wrong barcode, set using the Color class.
  • brush: The color of the solid shape laid over the barcode to indicate that it was rejected, set using the Color class.
  • feedback: The sound and vibration when a barcode is rejected.

The method also has a parameter to emit a sound and vibrate the device when it is called.

After these basics are in place, follow these steps to test your app.

How Scandit supports React Native barcode scanning

Scandit evolves RN barcode scanning from simple, single-feature libraries to an AI-powered engine that adapts to any workflow and edge case. With software battle-tested across hundreds of billions of scans on many types of devices, Scandit software scans the right code every time, regardless of label or environmental condition.

Scandit’s performance

Here’s what you get with the Scandit React Native SDK:

  • Decode speeds of 480 scans per minute, faster than human perception.
  • Accuracy >99% for common barcode symbologies.
  • Zero false positives for all major barcode types.
  • Reliable barcode scanning under less-than-ideal conditions: tiny, torn, damaged, curved, or shiny barcodes, long scan ranges, low light, and extreme angles.
  • Successful captures with camera resolutions as low as 240x320 pixels and barcode resolutions as low as 0.5 pixels per thin barcode element.

Underpinning these numbers is the Scandit Vision AI Engine, the intelligence behind the Scandit Smart Data Capture Platform, which powers our barcode, ID, and label scanning, as well as ShelfView products. Additionally, the Scandit React Native SDK is built on a C/C++ foundation, ensuring core features load efficiently in the background and consume minimal system resources.

Framework support

The Scandit React Native SDK supports Expo and other popular development frameworks. Barcode scanning libraries are also available for Native iOS, Native Android, JavaScript, Xamarin, Flutter, .NET (iOS, Android, and MAUI), Cordova, Capacitor, and Titanium.

You can see Scandit’s system requirements here.

Scandit’s security model

Scandit takes a security by design approach to all software, where you have complete control over data collection and processing. This means:

  • All image processing occurs on the device to ensure scanning confidentiality and high availability.
  • Any data you choose to share with Scandit is encrypted during transit and at rest.
  • Scandit is ISO 27001:2022 Certified and compliant with applicable privacy regulations, including GDPR and CCPA.

For a complete evaluation kit, read our guide to choosing the best barcode scanner SDK for your app.

How does Scandit compare with ML Kit and ZXing for React Native barcode scanning?

Here’s a table showing how we believe Scandit compares with the free ML Kit and ZXing barcode scanning libraries in the context of React Native. The versions compared are current as of July 2026, with ZXing in maintenance mode since 2019.

In summary, choose Scandit for production React Native workflows that need zero false positives, pre-built workflows, Expo support, advanced scanning features, and enterprise-grade support SLAs. Use ML Kit when you need Google’s machine vision APIs and can build the React Native bridge yourself. Use ZXing only when its maintenance status and features fit your risk profile.

Product features

Category

Scandit

ML Kit

ZXing

Native support for React Native

✓ Yes

✕ No

Third-party wrappers available

✕ No

Third-party wrappers available

Supported symbologies

1D formats:

Codabar, Code 11, Code 25, Code 32, Code 39, Code 93, Code 128, EAN-2, EAN-5, EAN-8, EAN-13, GS1 DataBar, IATA 2 of 5, ITF, JAN, Matrix 2 of 5, MSI Plessey, UPC-A, UPC-E

2D formats:

ArUco, Aztec, Data Matrix, Data Matrix Direct Part Marking (DPM), Data Matrix Rectangular Extension, DotCode, Micro PDF417, MaxiCode, Micro QR Code, PDF417, QR Code, Rectangular Micro QR Code

GS1 Composite Codes (A, B, C)

Postal codes:

Australia Post, French Postal Code (La Poste), KIX (Klant index), Posi LAPA 4 State Code, Royal Mail 4 State Customer Code (RM4SCC), Swiss Post, UPU (Universal PRM4SCC Barcode Symbology | Scanditostal Union) S18 4-State Code, USPS Intelligent Mail

Additional formats:

GS1 Data Carrier, 3D barcodes


1D formats:

Codabar, Code 39, Code 93, Code 128, EAN-8, EAN-13, ITF, UPC-A, UPC-E

2D formats:

Aztec, Data Matrix, PDF417, QR Code


1D formats:

Codabar, Code 39, Code 93, Code 128, EAN-8, EAN-13, ITF, UPC-A, UPC-E, UPC/EAN Extension 2/5

2D formats:

Aztec, Data Matrix, MaxiCode, PDF417, QR Code, RSS-14, RSS-Expanded

Automatic symbology detection

✓ Yes

✓ Yes

✓ Yes

Multiple barcode scanning

✓ Yes**

✓ Yes

✕ No*

Works with any orientation

✓ Yes

✓ Yes

✕ No

Gesture support

✓ Yes

✓ Yes

✕ No

Augmented reality assistance

✓ Yes

✕ No

Not natively (can be added with ARCore)

✕ No

Simultaneous barcode and text scanning data capture

✓ Yes

✕ No

✕ No

Low-level machine vision APIs

✕ No

✓ Yes

✕ No

Improved image capture using AI

✓ Yes

✕ No

Not natively (can be added with other Google APIs)

✕ No

Context-based scanning using AI

✓ Yes


✕ No

✕ No

Turnkey app

✓ Yes

Scandit Express

✕ No

✓ Yes

Barcode Scanner for Android***

Includes barcode scanning Agent Skills

✓ Yes

(Scandit Agent Skills)

✕ No

✕ No

Native support for Expo

✓ Yes

✕ No

✕ No

User interface/pre-built components

✓ Yes

✕ No

✕ No

Enterprise support and SLAs

✓ Yes

Full lifecycle support from trial to production; 24/7 support available

✓ Yes

Available through Google Cloud Customer Care

✕ No

*According to the ZXing documentation, it detects multiple barcodes by repeatedly decoding portions of the image. After one barcode is found, the areas left, above, right, and below it are scanned recursively.

**The Scandit SDK detects multiple barcodes in full-frame images in real-time, and tracks their positions as they move in and out of frame.

***According to the ZXing documentation, “The Barcode Scanner app can no longer be published, so it's unlikely any changes will be accepted for it. It does not work with Android 14 and will not be updated.”

Security and compliance

Security Category

Scandit

ML Kit

ZXing

On-device processing

✓ Yes

✓ Yes

✓ Yes

Scans offline

✓ Yes

✓ Yes

✓ Yes

Data encryption (in-transit and at-rest)

✓ Yes

✓ Yes

✕ No

Usage tracking

✓ Yes

Customers can choose whether metadata is transferred to external servers or not. Data is only transmitted for debugging, statistical analysis, performance monitoring, improvements and/or license compliance purposes.

✓ Yes

Data collected is listed here.

✕ No

CCPA

✓ Yes

✓ Yes

Via Google Cloud

✕ No

GDPR

✓ Yes

✓ Yes

Via Google Cloud

✕ No

ISO 27001

✓ Yes

✓ Yes

Via Google Cloud

✕ No

These results are based on side-by-side feature comparisons in April 2025 (ML Kit) and December 2025 (ZXing). For a deeper comparison between Scandit and these libraries, including performance testing results, read our ML Kit Barcode Scanner vs. Scandit and ZXing Barcode Scanner vs. Scandit blogs.

Get a React Native barcode scanner that knows how you work

Your barcode scanning solution is more than just a technical choice, it should improve user satisfaction and optimize operations by handling all the edge cases of your business. Prioritizing AI and other assistive features to ensure rapid deployment and the right barcode is scanned every time leads to greater adoption and productivity.

“The iOS and open-source solutions didn’t work that well, especially in difficult and low lighting or with damaged codes. The Scandit context-aware AI engine helps eliminate unintentional scans, a result of the environments Yuka users usually scan products in, such as the store, pantry, or fridge, where barcodes are heavily prevalent. ”

Next: Dive Deeper

Frequently asked questions

Loading search...

Please wait a moment