Popularity
7.0
Stable
Activity
5.4
Declining
1,504
22
178

Monthly Downloads: 0
Programming language: JavaScript
License: ISC License
Tags: Utilities     React     React-component     Qrcode    

qrcode.react alternatives and similar libraries

Based on the "Utilities" category

Do you think we are missing an alternative of qrcode.react or a related project?

Add another 'Utilities' Library

README

qrcode.react

A React component to generate QR codes.

Installation

npm install qrcode.react

Usage

var React = require('react');
var QRCode = require('qrcode.react');

React.render(
  <QRCode value="http://facebook.github.io/react/" />,
  mountNode
);

Available Props

prop type default value
value string
renderAs string ('canvas' 'svg') 'canvas'
size number 128
bgColor string (CSS color) "#FFFFFF"
fgColor string (CSS color) "#000000"
level string ('L' 'M' 'Q' 'H') 'L'
includeMargin boolean false

Custom Styles

qrcode.react will pass through any additional props to the underlying DOM node (<svg> or <canvas>). This allows the use of inline style or custom className to customize the rendering. One common use would be to support a responsive layout.

Note: In order to render QR Codes in <canvas> on high density displays, we scale the canvas element to contain an appropriate number of pixels and then use inline styles to scale back down. We will merge any additional styles, with custom height and width overriding our own values. This allows scaling to percentages but if scaling beyond the size, you will encounter blurry images. I recommend detecting resizes with something like react-measure to detect and pass the appropriate size when rendering to <canvas>.

LICENSE [ISC](LICENSE)


*Note that all licence references and agreements mentioned in the qrcode.react README section above are relevant to that project's source code only.