44A react-native component to generate [ QRcode] ( http://en.wikipedia.org/wiki/QR_code ) .
55
66## Installation
7+
78``` sh
8- npm install react-native-qrcode --save
9+ npm install react-native-qrcode-generator --save
910```
11+
12+ * (** Note** : If you want to use the original unmaintained package, [ visit this link] ( https://github.com/cssivision/react-native-qrcode ) ).*
13+
1014## Usage
1115``` jsx
1216' use strict' ;
1317
1418import React , { Component } from ' react'
15- import QRCode from ' react-native-qrcode' ;
19+ import QRCode from ' react-native-qrcode-generator ' ;
1620
1721import {
1822 AppRegistry ,
@@ -37,7 +41,7 @@ class HelloWorld extends Component {
3741 < QRCode
3842 value= {this .state .text }
3943 size= {200 }
40- bgColor= ' purple '
44+ bgColor= ' black '
4145 fgColor= ' white' / >
4246 < / View>
4347 );
@@ -66,17 +70,24 @@ AppRegistry.registerComponent('HelloWorld', () => HelloWorld);
6670
6771module .exports = HelloWorld;
6872```
73+
74+ #### Output :
75+
76+ <img src =' qrcode.png ' height = ' 256 ' width = ' 256 ' />
77+
78+ ##
79+
6980## Available Props
7081
71- prop | type | default value
82+ prop | type | Description
7283----------|----------------------|--------------
73- ` value ` | ` string ` | ` http://facebook.github.io/react-native/ `
74- ` size ` | ` number ` | ` 128 `
75- ` bgColor ` | ` string ` (CSS color) | ` "#000" `
76- ` fgColor ` | ` string ` (CSS color) | ` "#FFF" `
84+ ` value ` | ` string ` ( ** Default** : ` http://facebook.github.io/react-native/ ` ) | Value of the QRCode.
85+ ` size ` | ` number ` ( ** Default** : ` 128 ` ) | Size of the qrcode / image.
86+ ` bgColor ` | ` string ` ( ** Default** : ` white ` ) | Background Color for the qrcode / image.
87+ ` fgColor ` | ` string ` ( ** Default** : ` black ` ) | Foreground Color for the qrcode / image.
88+ ` getImageOnLoad ` | ` function ` | Returns the base64 png image data * ( string )* .
7789
78- <img src =' qrcode.png ' height = ' 256 ' width = ' 256 ' />
7990
80- # Licenses
91+ ## Licenses
8192
82- All source code is licensed under the [ MIT License] ( https://github.com/cssivision /react-native-qrcode/blob/master/LICENSE ) .
93+ All source code is licensed under the [ MIT License] ( https://github.com/rishichawda /react-native-qrcode/blob/master/LICENSE ) .
0 commit comments