1.0.0 • Published 1 year ago

app-barcode-generator v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

@janiscommerce/app-barcode-generator

janis-logo

NPM Version

React native components for generating barcode and QRcode. The library provides two components according to the type of code you need to create

Installation

npm i @janiscommerce/app-barcode-generator

Barcode

Usage

import {Barcode} from '@janiscommerce/app-barcode-generator';
import {Text} from 'react-native';

<Barcode value="1234534" format="EAN8" />;
<Barcode value="1234534" format="EAN8" text={<Text>1234534</Text>} />;
<Barcode value="1234534" format="EAN8" onError={(error) => console.log(error)} />;

Props

PropTypeDescriptiondefault valuerequired
valuestringvalue to create barcodeyes
formatstringformat of barcode. See barcode typeyes
textfunctionReact native component to show value below barcodeno
backgroundColorstringBackground color for barcode#FFFno
onErrorfunctionCallback to execute when has errorno

Supported formats

  • CODE39
  • CODE128
  • CODE128A
  • CODE128B
  • CODE128C
  • EAN13
  • EAN8
  • EAN5
  • EAN2
  • UPC
  • UPCE
  • ITF14
  • ITF
  • MSI
  • MSI10
  • MSI11
  • MSI1010
  • MSI1110
  • pharmacode
  • codabar

QRCode

Usage

import {QRCode} from '@janiscommerce/app-barcode-generator';

<QRCode value="1234534" />;
<QRCode value="1234534" size={150} />;

Props

PropTypeDescriptiondefault valuerequired
valuestringvalue to create QRCodeyes
sizenumberSet width and heigth of QRCode100no
foregroundColorfunctionReact native component to show value below barcode#000no
backgroundColorstringBackground color for barcode#FFFno