React QRCode
https://github.com/zpao/qrcode.react
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' |
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.