0.1.1 • Published 11 days ago
react-native-barcoder v0.1.1
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