react-native-barcoder
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

React Native Barcoder

alt text

npm install react-native-barcoder

A minimal package for displaying a barcode on react-native.

import Barcode from 'react-native-barcoder';

const options = { /* add your options here*/ }

<Barcode value="barcoder" options={options}/>

options

set up the options parameter (taken from jsbarcode)

interface Options = {
  format: Format;
  width: number | { max?: number };
  height: number;
  color: string;
};

regarding each value inside options:

Value Type Default Comment
format Format 'CODE128' the format you want to use to display the barcode
width int 2 the width of the barcode, use max to apply a limit
height int 100 the height of the barcode
color string black the color of the bars of the barcode

NB: the minimum bar width that can be set using max width is 1. If the total width surpasses the max width, max width will be ignored and the barcode will be displayed with a bar width of 1

Package Sidebar

Install

npm i react-native-barcoder

Weekly Downloads

441

Version

0.1.1

License

MIT

Unpacked Size

12.4 kB

Total Files

12

Last publish

Collaborators

  • theblindhawk