npm.io
0.6.4 • Published 9 years ago

react-native-qr-barcode

Licence
ISC
Version
0.6.4
Deps
2
Vulns
0
Weekly
0
Stars
8

react-native-qr-barcode

React Native WebView component of BarCode and QRCode. Based on chenchunyong/react-native-barCode

Setup

npm i react-native-qr-barcode --save

Usage

import React, { Component } from 'react';
import { BarCode, QRCode } from 'react-native-qr-barcode'
import {
  AppRegistry,
  StyleSheet,
  View
} from 'react-native';

class QRBarcodeTest extends Component {
  render() {
    return (
      <View style={styles.container}>
        <BarCode style={{marginBottom: 15}} value='1234567890876543' />
        <QRCode value='Lorem ipsum dolor sit amet, consectetur, adipisci velit' 
                size={200} 
                fgColor='white' 
                bgColor='black'
                style={{marginTop: 15}} />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  }
});

AppRegistry.registerComponent('QRBarcodeTest', () => QRBarcodeTest);

Keywords