ramamurthynagaraj / RNZxing

React Native Zxing wrapper, Barcode generator
16 stars 15 forks source link

react-native-zxing

A react native component to generate barcode.

install

iOS manual setup

Android manual setup

protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        ...
        new ZxingPackage()
    );
}

Usage

import Zxing from 'Zxing'

class BarcodeComponent extends Component {

    render() {
        return (
            <View>
                <Zxing text="Text to be embedded in barcode"
                    format="AZTEC"
                    style={{height: 200 width: 200}}/>
            </View>)
    }
}

Props

Name Description Default Type
text text to be encoded in barcode - required none string
format Format of the barcode - required - 'AZTEC', 'CODABAR', 'CODE_39', 'CODE_93','CODE_128', 'DATA_MATRIX', 'EAN_8','EAN_13', 'ITF', 'MAXICODE', 'PDF_417','QR_CODE', 'RSS_14', 'RSS_EXPANDED', 'UPC_A', 'UPC_E', 'UPC_EAN_EXTENSION'
width width of barcode 200 int
height height of barcode 200 int

Custom styling

- Height and Width can be controlled from style props, same as View.propTypes.style.

P.S

Thanks to the react native community. PRs welcome.

License

MIT