
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-native-barcode-rnsvg
Advanced tools
A React Native barcode generator component using react-native-svg.
react-native-svg for better performance and compatibilitynpm install react-native-barcode-rnsvg
# or
yarn add react-native-barcode-rnsvg
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
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>
);
}
<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)}
/>
| 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'` |
textPosition | `'top' \ | 'bottom'` | 'bottom' |
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 |
CODE128 - CODE128 (default)EAN13 - EAN-13EAN8 - EAN-8EAN5 - EAN-5 (supplemental)EAN2 - EAN-2 (supplemental)UPC - UPC-ACODE39 - CODE39ITF14 - ITF-14ITF - Interleaved 2 of 5MSI - MSI PlesseyMSI10 - MSI Plessey with mod 10 check digitMSI11 - MSI Plessey with mod 11 check digitMSI1010 - MSI Plessey with mod 1010 check digitsMSI1110 - MSI Plessey with mod 1110 check digitspharmacode - Pharmaceutical Binary Codecodabar - CodabarThis 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"
/>
react-native-svg is actively maintained@react-native-community/artContributions are welcome! Please feel free to submit a Pull Request.
MIT
FAQs
A React Native barcode generator using react-native-svg
The npm package react-native-barcode-rnsvg receives a total of 146 weekly downloads. As such, react-native-barcode-rnsvg popularity was classified as not popular.
We found that react-native-barcode-rnsvg demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.