Skip to content
/ art-qr Public

JavaScript library to generate beautiful QR code in browser 艺术二维码

Notifications You must be signed in to change notification settings

LIU9293/art-qr

Repository files navigation

art-qr

Pure JavaScript library to generate beautiful QR code on websites

travis code style: prettier npm version

Installation

yarn add art-qr
/* or use npm if you prefer*/
npm install art-qr -S

Usgae

All options can see here. Upon of the original version, we provide download method, see the code as example:

import ArtQR from 'art-qr';

// create something you can access to store the instance if you want
let MyQRInstance;

const img = new Image();
img.crossOrigin = "Anonymous";
img.src = YOUR_IMAGE_URL;

img.onload = () => {
  MyQRInstance = new ArtQR().create({
    text: YOUR_URL_OR_TEXT,
    size: 300,
    margin: 10,
    backgroundImage: img,
    callback: function (dataUri) {
      console.log(dataUri)
    },
    bindElement: 'qr' // id of <img /> in real dom
  });
}

// download the QR code is easy
MyQRInstance.download()

Credit

The project is a fork of Awesome-qr.js, and changed the build process/code style for esay use.

About

JavaScript library to generate beautiful QR code in browser 艺术二维码

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •