npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-barcode-rnsvg

v1.0.2

Published

A React Native barcode generator using react-native-svg

Readme

react-native-barcode-rnsvg

A React Native barcode generator component using react-native-svg.

Features

  • 🎯 SVG-based rendering - Uses react-native-svg for better performance and compatibility
  • 📊 Multiple barcode formats - Supports CODE128, EAN, UPC, CODE39, ITF, MSI, and more
  • 🎨 Highly customizable - Colors, dimensions, text positioning, margins
  • 📱 React Native optimized - Works on both iOS and Android
  • 💪 TypeScript support - Fully typed for better development experience

Installation

npm install react-native-barcode-rnsvg
# or
yarn add react-native-barcode-rnsvg

Peer Dependencies

Make sure you have these peer dependencies installed:

npm install react-native-svg
# For iOS, you'll also need to run:
cd ios && pod install

Usage

Basic Example

import React from 'react';
import { View } from 'react-native';
import { Barcode } from 'react-native-barcode-rnsvg';

export default function App() {
  return (
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <Barcode value="123456789012" format="CODE128" />
    </View>
  );
}

Advanced Example

<Barcode
  value="1234567890128"
  format="EAN13"
  width={3}
  height={100}
  displayValue={true}
  fontSize={18}
  lineColor="#000000"
  background="#FFFFFF"
  margin={20}
  onError={(error) => console.log('Barcode error:', error)}
/>

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | value | string | Required | The value to encode in the barcode | | format | BarcodeFormat | 'CODE128' | Barcode format to use | | width | number | 2 | Width of individual bars | | height | number | 100 | Height of the barcode | | displayValue | boolean | true | Whether to display the value below/above the barcode | | text | string | value | Custom text to display (if different from value) | | fontSize | number | 20 | Font size for the displayed text | | textAlign | 'left' \\| 'center' \\| 'right' | 'center' | Text alignment | | textPosition | 'top' \\| 'bottom' | 'bottom' | Position of the text relative to barcode | | textMargin | number | 2 | Margin between barcode and text | | background | string | '#FFFFFF' | Background color | | lineColor | string | '#000000' | Color of the barcode bars | | margin | number | 10 | Margin around the entire barcode | | marginTop | number | margin | Top margin (overrides margin) | | marginBottom | number | margin | Bottom margin (overrides margin) | | marginLeft | number | margin | Left margin (overrides margin) | | marginRight | number | margin | Right margin (overrides margin) | | flat | boolean | false | Flatten the barcode (remove start/end characters) | | onError | (error: Error) => void | undefined | Error callback function |

Supported Formats

  • CODE128 - CODE128 (default)
  • EAN13 - EAN-13
  • EAN8 - EAN-8
  • EAN5 - EAN-5 (supplemental)
  • EAN2 - EAN-2 (supplemental)
  • UPC - UPC-A
  • CODE39 - CODE39
  • ITF14 - ITF-14
  • ITF - Interleaved 2 of 5
  • MSI - MSI Plessey
  • MSI10 - MSI Plessey with mod 10 check digit
  • MSI11 - MSI Plessey with mod 11 check digit
  • MSI1010 - MSI Plessey with mod 1010 check digits
  • MSI1110 - MSI Plessey with mod 1110 check digits
  • pharmacode - Pharmaceutical Binary Code
  • codabar - Codabar

Migration from react-native-barcode-builder

This library provides a drop-in replacement for react-native-barcode-builder:

// Before (react-native-barcode-builder)
import { BarCodeBuilder } from 'react-native-barcode-builder';

<BarCodeBuilder
  value="123456789012"
  format="CODE128"
  width={2}
  height={100}
  lineColor="#000000"
  background="#FFFFFF"
/>

// After (react-native-barcode-rnsvg)
import { Barcode } from 'react-native-barcode-rnsvg';

<Barcode
  value="123456789012"
  format="CODE128"
  width={2}
  height={100}
  lineColor="#000000"
  background="#FFFFFF"
/>

Why react-native-svg?

  • Modern and maintained - react-native-svg is actively maintained
  • Better performance - SVG rendering is more efficient
  • Cross-platform consistency - Same rendering on iOS and Android
  • No deprecated dependencies - Doesn't rely on @react-native-community/art

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT