1.0.0 • Published 7 years ago

react-native-quark v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

react-native-quark

npm code style: standard code style: prettier

An ART-based qrcode component for react-native, which is much faster than those based WebView.

screenshot for react-native-quark

Prerequisite

This library is based on ART and works on both Android and iOS platform.

ART has already been included in react-native, while not avaiable on iOS. Please follow the document to link ART on iOS manually.

Usage

  • Install
npm i react-native-quark
  • Use it
import React from 'react'
import { StyleSheet, View } from 'react-native'
import Quark from 'react-native-quark'

export default () => (
  <View style={styles.container}>
    <Quark value="Hello!" />
    <Quark value="Quark!" style={styles.quark} />
    <Quark value="您好!" color="navy" />
  </View>
)

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center'
  },
  quark: {
    margin: 40,
    color: 'purple'
  }
})

Prop Types

NameTypeDefaultDescription
valuestring-QRCode content, required
size?number128size of the QRCode
color?string'black'color of the QRCode
backgroundColor?string'transparent'background color of the QRCode
errorCorrectLevel?string'M'errorCorrectLevel of the QRCode
styleanynullstyle of ART.Surface component

You can set color and backgroundColor in style.

Acknowledge

The word "QR Code" is registered trademark of DENSO WAVE INCORPORATED. And you can use it without any fee, according to QR Code FAQ.

License

MIT