qrcode dom element
var qr = require('qr-element');
// default canvas rendering
var qrcode = qr('foo', {
width: 128,
height: 128
});
qrcode // =>
interactive readme
interactive example
package your app with browserify
<script src="https://raw.github.com/shtylman/qr-element/master/dist/qr.js"></script>
<script>
var qrcode = qr('foo', {
width: 128,
height: 128
});
document.body.appendChild(qrcode);
</script>
qr
is exposed to the global namespace or it can work with other module loading system.
default 'canvas'
Optionally specify 'table' if you want rendering to be done via an html table versus canvas. 'table' fallback will be used automatically if canvas is not available in the browser.
Width in pixels of the element
Height in pixels of the element
default #fff
Background color hex
default #000
Foreground color hex
npm install qr-element
Use with browserify