@pluginjs/qrcode v0.8.11
Qrcode
A flexible modern qrcode js plugin.
Introduction
Installation
Yarn
yarn add @pluginjs/qrcode
NPM
npm i @pluginjs/qrcode
Getting Started
CDN:
Development:
<script src="https://unpkg.com/@pluginjs/qrcode/dist/qrcode.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/qrcode/dist/qrcode.css">
Production:
<script src="https://unpkg.com/@pluginjs/qrcode/dist/qrcode.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/qrcode/dist/qrcode.min.css">
Initialize
HTML:
<div class="element"></div>
ECMAScript Module:
import qrcode from "@pluginjs/qrcode"
import "@pluginjs/qrcode/dist/qrcode.css"
qrcode.of(document.querySelector('.element'), options)
CommonJS:
require("@pluginjs/qrcode/dist/qrcode.css")
const qrcode = require("@pluginjs/qrcode")
qrcode.of(document.querySelector('.element'), options)
Browser:
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/qrcode/dist/qrcode.css">
<script src="https://unpkg.com/@pluginjs/qrcode/dist/qrcode.js"></script>
<script>
Pj.qrcode('.element', options)
</script>
API
Options
Options are called on qrcode instances through the qrcode options itself. You can also save the instances to variable for further use.
Name | Description | Default |
---|---|---|
"text" | QR Code content. |
|
"padding" | white space padding. | 10 |
"width" | QR Code width in pixels | 256 |
"height" | QR Code height in pixels | 256 |
"reverse" | Use parent background as background | false |
"background" | color of background, color name or hex string. | #000000 |
"foreground" | color of modules, color name or hex string. | #ffffff |
"correctLevel" | error correction level. | L , M , H , Q |
More options references the jrQrcode's options.
Events
Events are called on qrcode instances through the qrcode events itself. You can also save the instances to variable for further use.
Name | Description |
---|---|
"ready" | Gets fired when plugin is ready |
"destroy" | Gets fired when plugin is destroy |
Methods
Methods are called on qrcode instances through the qrcode method itself. You can also save the instances to variable for further use.
Name | Description |
---|---|
"destroy" | Destroy plugin |
Browser support
Tested on all major browsers.
IE / Edge | Firefox | Chrome | Safari | Opera |
---|---|---|---|---|
IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
License
@pluginjs/qrcode is Licensed under the GPL-v3 license.
If you want to use @pluginjs/qrcode project to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary.
For purchase an Commercial License, contact us purchase@thecreation.co.
Copyright
Copyright (C) 2022 Creation Studio Limited.